Package cruise.umple.parser.rules
Class RootRule
java.lang.Object
cruise.umple.parser.rules.ChoiceRule
cruise.umple.parser.rules.RootRule
public class RootRule extends ChoiceRule
The only difference between a root rule and a choice rule is that after parsing the parse position must be at the end of the file for this rule to pass
-
Constructor Summary
Constructors Constructor Description RootRule(java.lang.String aName)
RootRule(java.lang.String name, ChoiceRule... rules)
For passing to super constructor. -
Method Summary
Modifier and Type Method Description void
delete()
int
parse(Token token, int from, int max, java.lang.String input, ParserDataPackage data)
Does exactly the same as the ChoiceRule, except it will return -1 if the parseResult was not the same as the input's length, i.e.Methods inherited from class cruise.umple.parser.rules.ChoiceRule
add, add, addAllTokens, addRule, addToken, dontCare, findPosition, get, getAction, getDeclared, getDontDelete, getFirstValue, getFirstValueBuilder, getName, getNegate, getNoSpaces, getOptional, getParent, getReset, getRule, getRules, hasRules, indexOf, indexOfRule, isNoSpaces, isOptional, numberOfRules, optimize, optimizeCondition, remove, remove, removeRule, resetDeclare, setAction, setDeclared, setDontDelete, setFirstValueBuilder, setName, setNegate, setNoSpaces, setOptional, setParent, setReset, setSubrules, size, toCannotBeString, toDeclareString, toRedoRegexString, toString
-
Constructor Details
-
Method Details
-
delete
public void delete()- Overrides:
delete
in classChoiceRule
-
parse
Does exactly the same as the ChoiceRule, except it will return -1 if the parseResult was not the same as the input's length, i.e. it will fail if some of the file was not parsed.- Overrides:
parse
in classChoiceRule
-