diff --git a/framework/sql/src/org/ofbiz/sql/Parser.jj b/framework/sql/src/org/ofbiz/sql/Parser.jj index 2a021db063..af72fcf355 100644 --- a/framework/sql/src/org/ofbiz/sql/Parser.jj +++ b/framework/sql/src/org/ofbiz/sql/Parser.jj @@ -17,11 +17,11 @@ * under the License. */ options { - JAVA_UNICODE_ESCAPE = false; - ERROR_REPORTING = true; - STATIC = false; + JAVA_UNICODE_ESCAPE = false; + ERROR_REPORTING = true; + STATIC = false; // MULTI = true; - JDK_VERSION = "1.5"; + JDK_VERSION = "1.5"; // VISITOR = true; // BUILD_NODE_FILES = true; // NODE_FACTORY = false; @@ -31,10 +31,10 @@ options { // DEBUG_PARSER = true; // DEBUG_LOOKAHEAD = true; // DEBUG_TOKEN_MANAGER = true; - LOOKAHEAD = 1; + LOOKAHEAD = 1; // CHOICE_AMBIGUITY_CHECK = 3; // OTHER_AMBIGUITY_CHECK = 3; - IGNORE_CASE = true; + IGNORE_CASE = true; } PARSER_BEGIN(Parser) @@ -85,66 +85,66 @@ TOKEN_MGR_DECLS: { } TOKEN: { - -| -| -| -| -| -| -| -| -| -| -| -| -| -//| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| { pushState(IN_DQUOTE); } -| { pushState(IN_SQUOTE); } -| + | + | + | + | + | + | + | + | + | + | + | + | + | +// | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | { pushState(IN_DQUOTE); } + | { pushState(IN_SQUOTE); } + | -| -| -//| + | + | +// | } @@ -159,8 +159,8 @@ MORE: { MORE: { - <(~[])> -| { popState(); } + <(~[])> + | { popState(); } } @@ -175,8 +175,8 @@ TOKEN: { TOKEN: { - -| { popState(); } + + | { popState(); } } @@ -186,97 +186,82 @@ TOKEN: { // ------------------- -public List> SQLFile(): -{ +public List> SQLFile(): { List> list = FastList.newInstance(); SQLStatement statement; -} -{ - ( statement=Statement() ( )? { list.add(statement); } )* +} { + ( + statement=Statement() ( )? + { list.add(statement); } + )* { return list; } } -public SQLStatement StandaloneStatement(): -{ +public SQLStatement StandaloneStatement(): { SQLStatement statement; -} -{ - statement=Statement() ( )? { return statement; } +} { + statement=Statement() ( )? + { return statement; } } -public SQLView ViewStatement(): -{ +public SQLView ViewStatement(): { SQLView sqlView; -} -{ - sqlView=View() ( )? { return sqlView; } +} { + sqlView=View() ( )? + { return sqlView; } } -public SQLSelect SelectStatement(): -{ +public SQLSelect SelectStatement(): { SQLSelect sqlSelect; -} -{ +} { sqlSelect=Select() ( )? { return sqlSelect; } } -public SQLDelete DeleteStatement(): -{ +public SQLDelete DeleteStatement(): { SQLDelete sqlDelete; -} -{ +} { sqlDelete=Delete() ( )? { return sqlDelete; } } -public SQLUpdate UpdateStatement(): -{ +public SQLUpdate UpdateStatement(): { SQLUpdate sqlUpdate; -} -{ +} { sqlUpdate=Update() ( )? { return sqlUpdate; } } -public SQLInsert InsertStatement(): -{ +public SQLInsert InsertStatement(): { SQLInsert sqlInsert; -} -{ +} { sqlInsert=Insert() ( )? { return sqlInsert; } } -public Condition Condition(): -{ Condition c; } -{ +public Condition Condition(): { + Condition c; +} { c=ConditionExpression() { return c; } } -private SQLStatement Statement(): -{ +private SQLStatement Statement(): { SQLStatement statement; -} -{ +} { ( - statement=Select() { return statement; } - | statement=Delete() { return statement; } - | statement=Update() { return statement; } - | statement=Insert() { return statement; } - | statement=View() { return statement; } + statement=Select() { return statement; } + | statement=Delete() { return statement; } + | statement=Update() { return statement; } + | statement=Insert() { return statement; } + | statement=View() { return statement; } ) } -private SQLView View(): -{ +private SQLView View(): { String name; SQLSelect sqlSelect; -} -{ - name=NamePart() sqlSelect=Select() - { return new SQLView(name, sqlSelect); } +} { + name=NamePart() sqlSelect=Select() { return new SQLView(name, sqlSelect); } } -private SQLSelect Select(): -{ +private SQLSelect Select(): { Integer i; boolean isDistinct = false; List orderBy = null; @@ -288,8 +273,7 @@ private SQLSelect Select(): Map relations = FastMap.newInstance(); Condition whereCondition = null, havingCondition = null; int offset = -1, limit = -1; -} -{ +} {