clean
[cdsspec-compiler.git] / grammer / spec-compiler.jj
1 /* spec-compiler.jj Grammer definition for the specification */
2
3 options {
4         STATIC = false;
5         JAVA_UNICODE_ESCAPE = true;
6 }
7
8 PARSER_BEGIN(SpecParser)
9 package edu.uci.eecs.specCompiler.grammerParser;
10
11         class SpecParser {
12                 public static void main(String[] argvs)
13                 throws ParseException, TokenMgrError {
14                         SpecParser parser = new SpecParser(System.in);
15                         parser.Start();
16                         System.out.println("Parsing finished!");
17                 }
18         }
19 PARSER_END(SpecParser)
20
21 SKIP : {" " | "\n" | "\r" | "\r\n" | <COMMENT>}
22
23 TOKEN :
24 {
25         <SPACE: (" " | "\t")+>
26 |
27         <COMMENT: <SPACE> "#" (~["\n", "\r"])* ["\n", "\r"]>
28 |
29         <HEAD: "/**">
30 |
31         <TAIL: "*/">
32 |
33         <BEGIN: "@Begin">
34 |
35         <END: "@End">
36 |
37         
38 }
39
40 void Start() :
41 {}
42 {
43         <HEAD> <BEGIN> <END> <TAIL> <EOF>
44 }