use of org.antlr.works.ate.syntax.generic.ATESyntaxParser in project antlrworks by antlr.
the class GrammarPropertiesImpl method parsePropertiesString.
private static List<ATEToken> parsePropertiesString(final String content) {
class ParseProperties extends ATESyntaxParser {
public List<ATEToken> propertiesTokens;
public void parseTokens() {
propertiesTokens = new ArrayList<ATEToken>();
while (nextToken()) {
if (T(0).type == ATESyntaxLexer.TOKEN_ID) {
if (isChar(1, "=") || isChar(1, "\n"))
propertiesTokens.add(T(0));
}
}
}
}
GrammarSyntaxLexer lexer = new GrammarSyntaxLexer();
lexer.tokenize(content);
ParseProperties parser = new ParseProperties();
parser.parse(lexer.getTokens());
return parser.propertiesTokens;
}
Aggregations