Author: doogie
Date: Fri Nov 13 07:47:04 2009
New Revision: 835768
URL:
http://svn.apache.org/viewvc?rev=835768&view=revLog:
Inline AllField and FieldDef, which lets LOOKAHEAD be removed.
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/Parser.jj
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/Parser.jj
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/Parser.jj?rev=835768&r1=835767&r2=835768&view=diff==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/Parser.jj (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/Parser.jj Fri Nov 13 07:47:04 2009
@@ -267,20 +267,22 @@
}
private void FieldDef(DynamicViewEntity dve):
-{}
{
- LOOKAHEAD(AllField()) AllField(dve)
-| FieldSpec(dve)
-}
-
-private void AllField(DynamicViewEntity dve):
-{
- String n;
+ List<String> fieldUse;
+ String tableAlias, fieldName, fieldAlias = null;
}
{
- n=NamePart() <PERIOD>
- <STAR>
- { dve.addAliasAll(n, null); }
+ tableAlias=NamePart() <PERIOD>
+ (
+ <STAR> { dve.addAliasAll(tableAlias, null); }
+ | fieldName=NamePart() ( <AS> fieldAlias=NamePart() )? {
+ if (fieldAlias == null) {
+ dve.addAlias(tableAlias, fieldName);
+ } else {
+ dve.addAlias(tableAlias, fieldAlias, fieldName, null, null, null, null);
+ }
+ }
+ )
}
private String NamePart():
@@ -289,23 +291,6 @@
<NAME> { return getToken(0).image; }
}
-private void FieldSpec(DynamicViewEntity dve):
-{
- List<String> fieldUse;
- String tableAlias, fieldName, fieldAlias = null;
-}
-{
- tableAlias=NamePart() <PERIOD> fieldName=NamePart()
- ( <AS> fieldAlias=NamePart() )?
- {
- if (fieldAlias == null) {
- dve.addAlias(tableAlias, fieldName);
- } else {
- dve.addAlias(tableAlias, fieldAlias, fieldName, null, null, null, null);
- }
- }
-}
-
private String DQuoted():
{ StringBuilder sb = new StringBuilder(); }
{