Author: doogie
Date: Mon Aug 2 17:41:44 2010
New Revision: 981614
URL:
http://svn.apache.org/viewvc?rev=981614&view=revLog:
REFACTOR: Optimize select AS support, so it is only required in one place.
Modified:
ofbiz/trunk/framework/sql/src/org/ofbiz/sql/Parser.jj
Modified: ofbiz/trunk/framework/sql/src/org/ofbiz/sql/Parser.jj
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/sql/src/org/ofbiz/sql/Parser.jj?rev=981614&r1=981613&r2=981614&view=diff==============================================================================
--- ofbiz/trunk/framework/sql/src/org/ofbiz/sql/Parser.jj (original)
+++ ofbiz/trunk/framework/sql/src/org/ofbiz/sql/Parser.jj Mon Aug 2 17:41:44 2010
@@ -511,13 +511,13 @@ private void FieldDef(Map<String, FieldD
fieldAlls.add(fieldAll); return;
}
| n=NamePart() (
- <PERIOD> fieldName=NamePart() ( <AS> fieldAlias=NamePart() )? { v = new FieldValue(n, fieldName); }
- | v=FunctionCallRest(n) ( <AS> fieldAlias=NamePart() )?
- | ( <AS> fieldAlias=NamePart() )? { v = new FieldValue(null, n); }
+ <PERIOD> fieldName=NamePart() { v = new FieldValue(n, fieldName); }
+ | v=FunctionCallRest(n)
+ | { v = new FieldValue(null, n); }
)
- | v=MathValue() ( <AS> fieldAlias=NamePart() )?
- | v=Count() ( <AS> fieldAlias=NamePart() )?
- ) {
+ | v=MathValue()
+ | v=Count()
+ ) ( <AS> fieldAlias=NamePart() )? {
def = new FieldDef(v, fieldAlias);
if (fieldDefs.containsKey(def.getAlias())) throw new ParseException("duplicate alias(" + def.getAlias() + ")");
fieldDefs.put(def.getAlias(), def);