Skip to content
José Carlos Ramalho edited this page Apr 24, 2014 · 6 revisions

GABS---Intermediate-Representation-Generator-for-Small-Compilers

LL(1) Concrete Grammar for Abstract Grammar description

Terminal symbols

List of terminal symbols and their description:

Symbol Description
OGA OpenGrammarAbstract: currently being "<ga>"
CGA CloseGrammarAbstract: currently being "</ga>"
SEP Block separator: currently being ";"
SIMBN Non terminal symbol: currently being a sequence of letters or digits starting with a capital letter
SIMBT Terminal symbol: currently being one of "INT" or "STR" keywords
ODLIST Open Derivation List: currently being the sequence "->"
ID Constructor identifier: currently being a sequence starting with "cons_" followed by letters or digits
ODER Open Derivation: currently being "("
CDER Close Derivation: currently being ")"

Productions

  Gabs -> OGA BlockList CGA ;

  BlockList -> Block SEP BlockList
             |  
             ;

  Block -> SIMBN ODLIST DList ;

  DList -> Deriv DList2;

  DList2 -> SEPDLIST Deriv DList2
          |
          ;

  Deriv -> ID ODER SimbList CDER;

  SimbList -> Simb SimbList
            |
            ;

  Simb -> SIMBT
        | SIMBN
        ;