use of dyvilx.tools.compiler.parser.header.SourceFileParser in project Dyvil by Dyvil.
the class REPLParser method parse.
@Override
public void parse(IParserManager pm, IToken token) {
final int type = token.type();
if (type == Tokens.EOF) {
pm.popParser();
return;
}
switch(this.mode) {
case ELEMENT:
this.mode = SEPARATOR;
if (TRY_PARSER.tryParse(pm, new SourceFileParser(this.context).withFlags(ONE_ELEMENT | NO_CLASSES), token, EXIT_ON_ROOT)) {
return;
}
if (TRY_PARSER.tryParse(pm, new MemberParser<>(this.context), token, EXIT_ON_ROOT)) {
return;
}
pm.pushParser(new ExpressionParser(this.context));
return;
case SEPARATOR:
this.mode = ELEMENT;
switch(type) {
case BaseSymbols.SEMICOLON:
case BaseSymbols.COMMA:
return;
}
pm.report(token, "statement_list.semicolon");
}
}
use of dyvilx.tools.compiler.parser.header.SourceFileParser in project Dyvil by Dyvil.
the class ClassUnit method parse.
@Override
public void parse() {
new ParserManager(DyvilSymbols.INSTANCE, this.tokens.iterator(), this.markers).parse(new SourceFileParser(this));
this.tokens = null;
}
Aggregations