Package com.gengoai.parsing
Class ParserGenerator
- java.lang.Object
-
- com.gengoai.parsing.ParserGenerator
-
- All Implemented Interfaces:
Serializable
public class ParserGenerator extends Object implements Serializable
Generates aParser
objects that uses a pre-definedGrammar
to parse theParserToken
s extracted using the pre-definedLexer
.- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Parser
create(Resource input)
Creates aParser
over the lexed tokens in the give inputParser
create(String input)
Creates aParser
over the lexed tokens in the give inputstatic ParserGenerator
parserGenerator(Grammar grammar, Lexer lexer)
-
-
-
Method Detail
-
parserGenerator
public static ParserGenerator parserGenerator(Grammar grammar, Lexer lexer)
- Parameters:
grammar
- the grammarlexer
- the lexer- Returns:
- the parser generator
-
create
public Parser create(String input)
Creates aParser
over the lexed tokens in the give input- Parameters:
input
- the input to parser- Returns:
- the Parser
-
create
public Parser create(Resource input) throws IOException
Creates aParser
over the lexed tokens in the give input- Parameters:
input
- the input to parser- Returns:
- the Parser
- Throws:
IOException
-
-