Topic: semantic grammar

topics > computer science > programming > Group: types of programming languages


function syntax by pattern
data-driven design
grammar modification
primitive functions
programming with a database of modules
Thesa data model
van Wijngaarden grammar
virtual machine
words defined by words


Semantic grammars consist of grammar rules with attached semantic definitions. The grammar rule consists of a pattern of data types and literals. The semantic section is calls to other rules or primitive actions. Examples are Koster's affix grammars, Bell's IMP, Katzenelson & Milgram's AEPL, van Meurs and Cardozo's BACO, and others. Thesa owes much debt to these languages.

Advantages -- Extensibility is built into the language with its incrementally developed grammar and bootstrapped representation. Most of the language is defined in terms of itself. (cbb 5/80)

Subtopic: language as grammar up

Quote: every sentence of a programming language should have one and only one meaning; unambiguous grammar; each syntactic rule has a semantic rule
QuoteRef: boscR9_1973 ;;4 treats language as a grammar
Quote: with declarative semantic grammar can mix top-down with bottom-up parsing [»barbME7_1983]

Subtopic: operational semantics up

Quote: structural operational semantics recovers compositionality through the syntactic structure of the language [»degaP6_2001]

Subtopic: operation syntax up

Quote: declare operations as a pattern giving data types, operator, and result type [»solnN_1971, OK]
Quote: define operations as a pattern with its data types and corresponding routine [»wegbB5_1974, OK]

Subtopic: syntax identifies command up

Quote: program by writing a grammar and embedding processing within the grammar [»hehnEC3_1983]
Quote: compiler classifies a statement by pattern and calls appropriate routine [»nappRB2_1976, OK]
Quote: in BACO, install a new command by adding an entry to the symbol table and linking the required routines [»vanmJ1_1977]
Quote: lexical semantics: index language semantics by its tokens; makes syntax tree transparent [»pratVR3_1974]

Subtopic: pattern identifies rule up

Quote: parse by matching patterns in a table, plus user-defined transformations
Quote: highest priority match determines a rule; execute its action routine and its semantic routine (produces invocation code) [»woolJD_1973]
Quote: in a semantic grammar, the value part defines the function value for a node in the pattern part [»barbME7_1983]
Quote: example of Parsley semantic grammar rule for defining a form function by pattern matching [»barbME7_1983]

Subtopic: semantics by grammar rules up

Quote: IMP72 semantics by grammar rules that includes semantic action; gives example of 'increment' expression [»biloW5_1974, OK]
Quote: IMP72 semantic part is a quoted expression or a semantic routine for code generation, symbol operator, stack operator, or semantic condition [»biloW5_1974, OK]

Subtopic: affix grammar up

QuoteRef: kostCH_1974 ;; Koster x25 has formal definition of affix grammars
QuoteRef: kostCH_1974 ;;367 CDL is a form of affix grammars
QuoteRef: kostCH_1974 ;;368 affix grammar rules are ordered
QuoteRef: kostCH_1974 ;;370 affix grammars-- symbol either true or false, parameters by + and local variables by - eg foo+result+arg-var, macro substitution of action or predicates, backward labels and parenthesis
QuoteRef: kostCH_1974 ;;374 affix example: number+val-d: digit+val, rep:(digit+d, one more digit+val+d, :rep;). 'macro' 'action' one more digit= '1' :='1'*10+'2'. with digit+val returning the next digit

Subtopic: string transformation rules up

Quote: EPBNF grammar restarts the scan after each transformation
Quote: EPBNF grammar of ordered, guarded, string transformation rules that include a semantic program [»katzJ12_1971, OK]

Related Topics up

Group: grammar   (8 topics, 181 quotes)

Topic: function syntax by pattern (15 items)
Topic: data-driven design (41 items)
Topic: grammar modification (10 items)
Topic: macros (22 items)
Topic: primitive functions (34 items)
Topic: programming with a database of modules (94 items)
Topic: Thesa data model (58 items)
Topic: van Wijngaarden grammar (9 items)
Topic: virtual machine (13 items)
Topic: words defined by words
(25 items)

Updated barberCB 1/05
Copyright © 2002-2008 by C. Bradford Barber. All rights reserved.
Thesa is a trademark of C. Bradford Barber.