# BIPS (Built-in Phrases)are linked to the type-code returned # by the line-reconstruction code (aka lexer) # These *must* come first. B=1; B=5; B=6; B=3; B=2; # Phrase definitions. PROGRAM is the main entry point. # This is the first draft of a grammar, based on the one # collectively determined at the wiki site. At the moment # this has not been debugged extensively. P = "program" ; P = , ; P = , ; P = "begin" "end"; P = "begin" "end"; P = , ; P = , ; P = ',' , ; P = '#' ; P = "define" , "ifdef" , "endif"; P = , , , , ; P = '#' "include" , ; P = , ; P = ; P = "unsigned", ; P = "char", "int"; P = '*' , , ; P = '[' ']', ; P = "procedure" '(' ')' , "procedure" '(' ')' ; P = , ; P = , ; P = ',' , ; P = '*' , '*', , ; P = ; P = ',' , ; P = , ; P = ; P = , , , '#' "inline" , , ; P = "if" '(' ')' "endif"; P = "else" , ; P = "while" '(' ')' "endwhile"; P = "for" '(' = '(' ')', '(' ')', '=' ; P = ; P = , ; P = ',', ; P = '*' , '[' ']', ; P = , ; P = , ; P = ; P = , ; P = ; P = '&' , ; P = ; P = '!', ; P = ';', ; P = ; P = , ; P = ; P = , ; P = ; P = , ; P = , ; P = ; P = , ; P = '|', '~'; P = '<>', '<=', '<', '>=', '>', '!=', '='; P = '<<', '>>'; P = '+', '-'; P = '*', '/'; P = '(' ')', '&' '[' ']', '&' , , , ; # Shouldn't HEXNUM be here with NUM and CHARLIT? # The apparent restriction is that a HEXNUM cannot # be used as the size of an array declaration - but # a character constant can??? P = , ; E # 'E' is end of grammar. Everything after this is ignored.