
ango.1.18.source-code.parser.jjt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mango Show documentation
Show all versions of mango Show documentation
mango is a dao framework.
options
{
/** 使用jdk1.6 */
JDK_VERSION = "1.6";
/** 生成非静态方法 */
static = false;
/** 标记开始token与结束token */
TRACK_TOKENS=true;
/** 让jjtree给每个非终结符生成一个对象 */
MULTI = true;
/** 开启访问者模式 */
VISITOR = true;
/** 忽略大小写 */
IGNORE_CASE = true;
}
PARSER_BEGIN(Parser)
package org.jfaster.mango.parser;
import java.io.StringReader;
import java.io.Reader;
public class Parser {
public Parser(String s) {
this((Reader)(new StringReader(s)));
}
}
PARSER_END(Parser)
TOKEN:
{
<#COLON : ":" >
| <#NUMBER : ["1"-"9"] (["0"-"9"])* >
| <#DOT : "." >
| <#FIELD : ["a"-"z","_"] (["a"-"z","_", "0"-"9"])* >
| <#WHITESPACE : (" ")* >
}
TOKEN:
{
| "(" ")" >
|
| "}" >
| {SwitchTo(EXPRESSION);}
| {SwitchTo(EXPRESSION);}
|
|
|
|
|
|
|
}
SKIP :
{
" "
}
TOKEN:
{
|
|
|
| " | "gt" >
| =" | "ge" >
|
|
|
|
|
|
|
|
| {SwitchTo(DEFAULT);}
}
TOKEN:
{
(|) ( )* >
}
ASTRootNode parse() #RootNode : {}
{
( Insert() | Delete() | Update() | Select() ) ( Statement() )+ #Block
{
return jjtThis;
}
}
void Insert() :
{
Token t;
}
{
t=
{
jjtThis.setValue(t.image);
}
}
void Delete() :
{
Token t;
}
{
t=
{
jjtThis.setValue(t.image);
}
}
void Update() :
{
Token t;
}
{
t=
{
jjtThis.setValue(t.image);
}
}
void Select() :
{
Token t;
}
{
t=
© 2015 - 2025 Weber Informatics LLC | Privacy Policy