-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathJavadoc.g
executable file
·35 lines (28 loc) · 1005 Bytes
/
Javadoc.g
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
grammar Javadoc;
options {language=JavaScript;}
comment : ( author )* ;
author : '@author' ID {print("author "+$ID.text);} ;
ID : ('a'..'z'|'A'..'Z')+
;
SIMPLE : '{'
{
print("enter embedded Simple escape");
var lexer = new SimpleLexer(this.input);
var tokens = new org.antlr.runtime.CommonTokenStream(lexer);
//print("tokens="+tokens);
var parser = new SimpleParser(tokens);
parser.statement();
}
{$channel=HIDDEN;}
;
/** When the javadoc parser sees end-of-comment it just says 'I'm done', which
* consumes the tokens and forces this javadoc parser (feeding
* off the input stream currently) to exit. It returns from
* method comment(), which was called from JAVADOC action in the
* Simple parser's lexer.
*/
END : '*/' {this.emit(org.antlr.runtime.Token.EOF_TOKEN);}
{print("exit javadoc");}
;
WS : (' '|'\t'|'\n')+
;