* net/loveruby/cflat/parser/Parser.jj (fixedparams, fixedparam_typerefs, args): simplify lookahead.

git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3757 1b9489fe-b721-0410-924e-b54b9192deb8
This commit is contained in:
Minero Aoki 2007-12-24 20:53:23 +00:00
parent bda63ace95
commit 67a9866b59
2 changed files with 11 additions and 9 deletions

View File

@ -1,3 +1,8 @@
Tue Dec 25 05:53:19 2007 Minero Aoki <aamine@loveruby.net>
* net/loveruby/cflat/parser/Parser.jj (fixedparams,
fixedparam_typerefs, args): simplify lookahead.
Tue Dec 25 02:09:35 2007 Minero Aoki <aamine@loveruby.net>
* net/loveruby/cflat/parser/Parser.jj: expr0 -> expr1, expr1 ->

View File

@ -461,9 +461,8 @@ FixedParams fixedparams():
Parameter param;
}
{
param=param() { params.add(param); }
( LOOKAHEAD(",", {!getToken(2).image.equals("...")})
"," param=param() { params.add(param); } )*
param=param() { params.add(param); }
( LOOKAHEAD(2) "," param=param() { params.add(param); } )*
{
return new FixedParams(params);
}
@ -622,9 +621,8 @@ FixedParams fixedparam_typerefs():
TypeRef ref;
}
{
ref=typeref() { refs.add(ref); }
( LOOKAHEAD(",", {!getToken(2).image.equals("...")})
"," ref=typeref() { refs.add(ref); } )*
ref=typeref() { refs.add(ref); }
( LOOKAHEAD(2) "," ref=typeref() { refs.add(ref); } )*
{
return new FixedParams(refs);
}
@ -1073,9 +1071,8 @@ List args():
Node arg;
}
{
[ LOOKAHEAD({!getToken(1).image.equals(")")})
arg=expr() { args.add(arg); }
("," arg=expr() { args.add(arg); })* ]
[ arg=expr() { args.add(arg); }
("," arg=expr() { args.add(arg); })* ]
{
return args;
}