Tools
cocktail.asc
Associated article: Examining the Cocktail Toolbox
Tags: Tools Open Source Design
_EXAMINING THE COCKTAIL TOOLBOX_ by Rodney Bates Listing One 1 2 /* Concrete syntax */ 3 4 PARSER Parser 5 6 RULE 7 8 START = CsProgram . 9 10 /* Terminal symbol: */ 11 12 TokLiteral : 13 [ CaValue : CARDINAL ] 14 { CaValue := 0 ; } . 15 16 /* Main grammar: */ 17 18 CsProgram = CsStmt . 19 20 CsStmtPlus 21 = < CsStmtPlusLast = CsStmt . 22 CsStmtPlusMore 23 = CsStmt ';' CsStmtPlus . 24 > . 25 26 CsStmt 27 = < CsPrintStmt 28 = 'PRINT' ...