use of org.ballerinalang.toml.antlr4.TomlLexer in project ballerina by ballerina-lang.
the class TomlProcessor method parseTomlContent.
/**
* Generate the proxy object by passing in the toml file.
*
* @param stream charstream object containing the content
* @return proxy object
*/
public static ParseTree parseTomlContent(CharStream stream) {
TomlLexer lexer = new TomlLexer(stream);
// Get a list of matched tokens
CommonTokenStream tokens = new CommonTokenStream(lexer);
// Pass the tokens to the parser
TomlParser parser = new TomlParser(tokens);
return parser.toml();
}
use of org.ballerinalang.toml.antlr4.TomlLexer in project ballerina by ballerina-lang.
the class ConfigProcessor method buildParseTree.
private static ParseTree buildParseTree(CharStream configEntriesStream) {
TomlLexer lexer = new TomlLexer(configEntriesStream);
CommonTokenStream tokenStream = new CommonTokenStream(lexer);
TomlParser parser = new TomlParser(tokenStream);
return parser.toml();
}
Aggregations