Class AppParser
java.lang.Object
org.infosmid.stream.dsl.AppParser
- Direct Known Subclasses:
StreamParser
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AppNodeeatApp()Return aAppNodefrom the next token and advance the token position.protected ArgumentNode[]Return an array ofArgumentNodeand advance the token position if the next token(s) contain arguments.protected StringReturn the argument value from the next token and advance the token position.Return an array ofTokenthat are separated by a dot.Return theTokensthis parser is using.protected booleanisValidName(String name) Verify the supplied name is a valid name.protected AppNodemakeAppNode(LabelNode label, String appName, int startPos, int endPos, ArgumentNode[] arguments) protected StringReturn the concatenation of the data of multiple tokens.tokenListToStringList(List<Token> tokens) Return a list of string representations ofTokens.protected LabelNodetoLabelNode(Token label) Create a newLabelNodebased on the provided token.protected StringReturn the string representation of aToken.
-
Field Details
-
tokens
Tokens resulting from DSL parsing.
-
-
Constructor Details
-
AppParser
-
-
Method Details
-
getTokens
-
eatApp
-
eatAppArgs
Return an array ofArgumentNodeand advance the token position if the next token(s) contain arguments.Expected format:
appArguments : DOUBLE_MINUS identifier(name) EQUALS identifier(value)- Returns:
- array of arguments or
nullif the next token(s) do not contain arguments
-
eatArgValue
Return the argument value from the next token and advance the token position.Expected format:
argValue: identifier | literal_string- Returns:
- argument value
-
eatDottedName
-
toLabelNode
-
toData
-
tokenListToStringList
-
toString
-
isValidName
Verify the supplied name is a valid name. Valid names must follow the same rules as Java identifiers, with the additional option to use a hyphen ('-') after the first character.- Parameters:
name- the name to validate- Returns:
- true if name is valid
-
makeAppNode
protected AppNode makeAppNode(LabelNode label, String appName, int startPos, int endPos, ArgumentNode[] arguments)
-