Package jay.yydebug

Class yyDebugAdapter

java.lang.Object
jay.yydebug.yyDebugAdapter
All Implemented Interfaces:
yyDebug

public class yyDebugAdapter extends Object implements yyDebug
writes one-line messages to standard output or a stream.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final PrintStream
    message stream.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    accept(Object value)
    parse is successful.
    void
    discard(int state, int token, String name, Object value)
    discarding token during error recovery.
    void
    error(String message)
    syntax error.
    void
    lex(int state, int token, String name, Object value)
    just called the scanner.
    void
    pop(int state)
    discarding a state during error recovery.
    void
    push(int state, Object value)
    just pushed the state/value stack.
    void
    reduce(int from, int to, int rule, String text, int len)
    rule completed, calling action.
    void
    error recovery failed, about to throw yyException.
    void
    shift(int from, int to)
    moving to a new state following an action.
    void
    shift(int from, int to, int errorFlag)
    moving to a new state because of input or error.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • out

      protected final PrintStream out
      message stream.
  • Constructor Details

    • yyDebugAdapter

      public yyDebugAdapter(PrintStream out)
    • yyDebugAdapter

      public yyDebugAdapter()
  • Method Details

    • push

      public void push(int state, Object value)
      Description copied from interface: yyDebug
      just pushed the state/value stack.
      Specified by:
      push in interface yyDebug
      Parameters:
      state - current state.
      value - current value.
    • lex

      public void lex(int state, int token, String name, Object value)
      Description copied from interface: yyDebug
      just called the scanner.
      Specified by:
      lex in interface yyDebug
      Parameters:
      state - current state.
      token - just obtained from scanner.
      name - of token in grammar.
      value - will be obtained from scanner.
    • shift

      public void shift(int from, int to, int errorFlag)
      Description copied from interface: yyDebug
      moving to a new state because of input or error.
      Specified by:
      shift in interface yyDebug
      Parameters:
      from - current state.
      to - next state.
      errorFlag - value in next state.
    • pop

      public void pop(int state)
      Description copied from interface: yyDebug
      discarding a state during error recovery.
      Specified by:
      pop in interface yyDebug
      Parameters:
      state - discarded.
    • discard

      public void discard(int state, int token, String name, Object value)
      Description copied from interface: yyDebug
      discarding token during error recovery.
      Specified by:
      discard in interface yyDebug
      Parameters:
      state - current state.
      token - discarded.
      name - of token in grammar.
      value - will be obtained from scanner.
    • reduce

      public void reduce(int from, int to, int rule, String text, int len)
      Description copied from interface: yyDebug
      rule completed, calling action.
      Specified by:
      reduce in interface yyDebug
      Parameters:
      from - current state.
      to - state to be uncovered.
      rule - number of completed right-hand side.
      text - text of rule.
      len - number of symbols in rule.
    • shift

      public void shift(int from, int to)
      Description copied from interface: yyDebug
      moving to a new state following an action.
      Specified by:
      shift in interface yyDebug
      Parameters:
      from - current state.
      to - next state.
    • accept

      public void accept(Object value)
      Description copied from interface: yyDebug
      parse is successful.
      Specified by:
      accept in interface yyDebug
      Parameters:
      value - to be returned by yyparse().
    • error

      public void error(String message)
      Description copied from interface: yyDebug
      syntax error.
      Specified by:
      error in interface yyDebug
    • reject

      public void reject()
      Description copied from interface: yyDebug
      error recovery failed, about to throw yyException.
      Specified by:
      reject in interface yyDebug