support aliasing

This commit is contained in:
xvrl 2013-03-02 14:09:20 -08:00
parent f8a118dd98
commit 5d1af7d884
1 changed files with 7 additions and 1 deletions

View File

@ -148,7 +148,13 @@ datasource
;
aliasedExpression returns [PostAggregator p]
: expression ( AS^ name=IDENT )? { $p = $expression.p; }
: expression ( AS^ name=IDENT )? {
if($name != null) {
postAggregators.add($expression.p);
$p = new FieldAccessPostAggregator($name.text, $expression.p.getName());
}
else $p = $expression.p;
}
;
expression returns [PostAggregator p]