Class SimpleCommandLexer
java.lang.Object
net.apartium.cocoabeans.commands.lexer.SimpleCommandLexer
- All Implemented Interfaces:
CommandLexer
A simple command lexer tokenize commands, and then we could use it to parse the command
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new simple command lexer with SimpleArgumentParserToken and SimpleKeywordTokenSimpleCommandLexer(CommandTokenSupplier<ArgumentParserToken> argumentSupplier, CommandTokenSupplier<KeywordToken> keywordSupplier) Create a new simple command lexer -
Method Summary
Modifier and TypeMethodDescriptionTokenize the command into tokens
-
Constructor Details
-
SimpleCommandLexer
public SimpleCommandLexer()Create a new simple command lexer with SimpleArgumentParserToken and SimpleKeywordToken -
SimpleCommandLexer
public SimpleCommandLexer(CommandTokenSupplier<ArgumentParserToken> argumentSupplier, CommandTokenSupplier<KeywordToken> keywordSupplier) Create a new simple command lexer- Parameters:
argumentSupplier- the argument supplier to create argument parser tokenskeywordSupplier- the keyword supplier to create keyword tokens
-
-
Method Details
-
tokenize
Tokenize the command into tokens- Specified by:
tokenizein interfaceCommandLexer- Parameters:
command- the command to tokenize- Returns:
- the tokens after tokenization
-