work on account editing
[Bookkeeping.git] / grammar / bookkeeping.parser.g
blobb1fdd83698807ca00ec2b6d02cad2438126b3a90
2 /* PARSER 
3  */ 
4 class BookkeepingParser extends Parser;
5 options {
6         
7         k=10;
8         importVocab=BookkeepingLexer; 
9         buildAST=true;
10         
14 <!-- command -opts (token -opts(token)) -->
15 <!-- CREATE --> 
16 create(entry -entrynum -journal -date (
17                                 create(debit -entry -account -amount),
18                                         create(credit -entry -account -amount),
19                                                 create(credit -entry -account -amount)
20                         ));
21 create(journal -name(entry,entry,...));
22 create(transaction -date(entry,entry,...));
23 create(account -name -type -counterweight(debit|credit,...));
28 //token_literal:        TOKENLITERAL    { System.out.println("TOKEN LITERAL >>> Parser"); }; 
31 expr: t:TOKEN_LITERAL ( DELIMITER TOKEN_LITERAL )* 
32         { System.out.println( "EXPRESSION >>> Parser: "+ t.getText() ); };