progress on add/edit for journal entry
[Bookkeeping.git] / grammar / bookkeeping.lexer.2.g
blob4102575c3f52ab9497a8092e1a79d80212e679d8
3 /* LEXER 
4  */
5 class BookkeepingLexer extends XMLLexer;
7 options { 
8         
9     k=10; // needed for newline junk
10     charVocabulary='\u0000'..'\u007F'; // allow ascii
11         exportVocab=BookkeepingLexer; 
15 //TOKEN_LITERAL:        ("debit" | "credit")+;
16 LEFT_PAREN:     '('     { System.out.println("LEFT PARENTHESESE '('"); }; 
17 RIGHT_PAREN:    ')' { System.out.println("RIGHT PARENTHESESE ')'"); }; 
18 DELIMITER:              ',' { System.out.println("DELIMITER ','"); }; 
21 // OPTIONS 
22 OPT_ENTRY:              "-entry" WHITESPACE( 'A'..'Z' | 'a'..'z' | '0'..'9' )*  { System.out.println("-entry"); };
23 OPT_ACCOUNT:    "-account" WHITESPACE( 'A'..'Z' | 'a'..'z' | '0'..'9' )*;
24 OPT_JOURNAL:    "-journal" WHITESPACE( 'A'..'Z' | 'a'..'z' | '0'..'9' )*;
25 OPT_NAME:               "-name" WHITESPACE( 'A'..'Z' | 'a'..'z' | '0'..'9' )*;
26 OPT_TYPE:               "-type" WHITESPACE( 'A'..'Z' | 'a'..'z' | '0'..'9' )*; 
27 OPT_CWEIGHT:    "-counterWeight" WHITESPACE("debit"|"credit"); 
28 OPT_AMOUNT:             "-amount" WHITESPACE(('0'..'9')+'.'('0'..'9')('0'..'9'))*; 
29 OPT_ID:                 "-id" WHITESPACE( 'A'..'Z' | 'a'..'z' | '0'..'9' )*; 
30 OPT_ENTRYNUM:   "-entrynum" WHITESPACE('0'..'9')*;      
31 OPT_DATE:               "-date" WHITESPACE(('0'..'9')('0'..'9')'/'('0'..'9')('0'..'9')'/'('0'..'9')('0'..'9')('0'..'9')('0'..'9'))*; 
32 OPT_FILE:               "-F" WHITESPACE( 'A'..'Z' | 'a'..'z' | '0'..'9' )*; 
35 // COMMANDS 
36 COMMAND_CREATE:         ("create")+             { System.out.println("COMMAND_CREATE"); }; 
37 COMMAND_ADD!:           ("add")+                { System.out.println("COMMAND_ADD"); }; 
38 COMMAND_REMOVE:         ("remove")+             { System.out.println("COMMAND_REMOVE"); }; 
39 COMMAND_REVERSE:        ("reverse")+            { System.out.println("COMMAND_REVERSE"); }; 
40 COMMAND_FIND:           ("find")+                       { System.out.println("COMMAND_FIND"); }; 
41 COMMAND_LOAD:           ("load")+                       { System.out.println("COMMAND_LOAD"); }; 
42 COMMAND_LIST:           ("list")+                       { System.out.println("COMMAND_LIST"); }; 
43 COMMAND_LOGIN:          ("login")+                      { System.out.println("COMMAND_LOGIN"); }; 
44 COMMAND_LOGOUT:         ("logout")+             { System.out.println("COMMAND_LOGOUT"); }; 
45 COMMAND_EXIT:           ("exit")+               { System.out.println("COMMAND_EXIT"); }; 
49 // MISCELLANEOUS 
50 END_COMMAND:    ';'     { System.out.println("END COMMAND ';'"); }; 
51 WHITESPACE:     ( ' ' | '\r' | '\n' | '\t' ) {
52                 System.out.println("");
53                 System.out.println("WHITE SPACE ' '"); 
54                 $setType(Token.SKIP);
55         };