Initial check in docu
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
unit JavaDocLexer;
|
||||
|
||||
uses
|
||||
{
|
||||
dpgTokenStreamSelector;
|
||||
}
|
||||
|
||||
lexer TJavaDocLexer;
|
||||
options
|
||||
{
|
||||
k = 2;
|
||||
exportVocab = JavaDoc;
|
||||
filter = true;
|
||||
}
|
||||
|
||||
memberdecl
|
||||
{
|
||||
public
|
||||
Selector : IdpgTokenStreamSelector;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// @param
|
||||
// ----------------------------------------------------------------------------
|
||||
PARAM
|
||||
: "@param" (' ')+ ID
|
||||
;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// @exception
|
||||
// ----------------------------------------------------------------------------
|
||||
EXCEPTION
|
||||
: "@exception" (' ')+ ID
|
||||
;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// identifier
|
||||
// ----------------------------------------------------------------------------
|
||||
protected ID
|
||||
: ('a'..'z')+
|
||||
;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Star
|
||||
//
|
||||
// This rule simply prevents JAVADOC_CLOSE from being called for every '*' in
|
||||
// a comment. Calling JAVADOC_CLOSE will fail for simple '*' and cause an
|
||||
// exception, which is slow. In other words, the grammar will work without
|
||||
// this rule, but is slower.
|
||||
// ----------------------------------------------------------------------------
|
||||
STAR
|
||||
: '*' { _ttype := TT_SKIP; }
|
||||
;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// JavaDocClose
|
||||
// ----------------------------------------------------------------------------
|
||||
JAVADOC_CLOSE
|
||||
: "*/" { Selector.Pop; }
|
||||
;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// NewLine
|
||||
// ----------------------------------------------------------------------------
|
||||
NEWLINE
|
||||
:
|
||||
(
|
||||
'\r' '\n'
|
||||
| '\r'
|
||||
| '\n'
|
||||
)
|
||||
{
|
||||
newLine;
|
||||
_ttype := TT_SKIP;
|
||||
}
|
||||
;
|
||||
Reference in New Issue
Block a user