Class Machine

java.lang.Object
org.sonar.sslr.internal.vm.Machine
All Implemented Interfaces:
CharSequence

public class Machine extends Object implements CharSequence
Duplicates corresponding class from SSLR to improve:
  • Performance in case of parsing list of tokens multiple times, but with different starting positions. Hot spot for original class in such case - is a conversion from list to array.
  • Error reporting (see COBOL-873, COBOL-435).
  • Constructor Details

  • Method Details

    • parse

      public static ParseNode parse(List<Token> tokens, CompiledGrammar grammar)
    • parse

      public static ParsingResult parse(char[] input, CompiledGrammar grammar)
    • getAddress

      public int getAddress()
    • setAddress

      public void setAddress(int address)
    • jump

      public void jump(int offset)
    • popReturn

      public void popReturn()
    • pushReturn

      public void pushReturn(int returnOffset, Matcher matcher, int callOffset)
    • pushBacktrack

      public void pushBacktrack(int offset)
    • pop

      public void pop()
    • peek

      public MachineStack peek()
    • setIgnoreErrors

      public void setIgnoreErrors(boolean ignoreErrors)
    • backtrack

      public void backtrack()
    • createNode

      public void createNode()
    • createLeafNode

      public void createLeafNode(Matcher matcher, int offset)
    • getIndex

      public int getIndex()
    • setIndex

      public void setIndex(int index)
    • advanceIndex

      public void advanceIndex(int offset)
    • length

      public int length()
      Specified by:
      length in interface CharSequence
    • charAt

      public char charAt(int offset)
      Specified by:
      charAt in interface CharSequence
    • subSequence

      public CharSequence subSequence(int start, int end)
      Not supported.
      Specified by:
      subSequence in interface CharSequence
      Throws:
      UnsupportedOperationException - always
    • tokenAt

      public Token tokenAt(int offset)