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 Details

    • RootRule

      public RootRule​(java.lang.String aName)
    • RootRule

      public RootRule​(java.lang.String name, ChoiceRule... rules)
      For passing to super constructor.
  • Method Details

    • delete

      public void delete()
      Overrides:
      delete in class ChoiceRule
    • parse

      public 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. it will fail if some of the file was not parsed.
      Overrides:
      parse in class ChoiceRule