forked from jasder/antlr
commit
a872323474
|
@ -240,8 +240,30 @@ public class ParserExecDescriptors {
|
|||
|
||||
}
|
||||
|
||||
/** Match assignments, ignore other tokens with wildcard. */
|
||||
public static class Wildcard extends BaseParserTestDescriptor {
|
||||
public String input = "x=10; abc;;;; y=99;";
|
||||
public String output = "x=10;\ny=99;\n";
|
||||
public String errors = null;
|
||||
public String startRule = "a";
|
||||
public String grammarName = "T";
|
||||
|
||||
/**
|
||||
* This test ensures that {@link ParserATNSimulator} does not produce a
|
||||
grammar T;
|
||||
a : (assign|.)+ EOF ;
|
||||
assign : ID '=' INT ';' {
|
||||
<writeln("$text")>
|
||||
} ;
|
||||
ID : 'a'..'z'+ ;
|
||||
INT : '0'..'9'+;
|
||||
WS : (' '|'\n') -> skip;
|
||||
*/
|
||||
@CommentHasStringValue
|
||||
public String grammar;
|
||||
}
|
||||
|
||||
/**
|
||||
* This test ensures that {@link org.antlr.v4.runtime.atn.ParserATNSimulator} does not produce a
|
||||
* {@link StackOverflowError} when it encounters an {@code EOF} transition
|
||||
* inside a closure.
|
||||
*/
|
||||
|
|
|
@ -530,7 +530,7 @@ else {
|
|||
|
||||
Wildcard(w) ::= <<
|
||||
this.state = <w.stateNumber>;
|
||||
<if(w.labels)><w.labels:{l | <labelref(l)> = }><endif>matchWildcard();
|
||||
<if(w.labels)><w.labels:{l | <labelref(l)> = }><endif>this.matchWildcard();
|
||||
>>
|
||||
|
||||
// ACTION STUFF
|
||||
|
|
Loading…
Reference in New Issue