Package jay.yydebug

Class yyAnim

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, yyDebug

public class yyAnim extends Frame implements yyDebug
delegates messages to a yyAnimPanel and optionally intercepts standard i/o. This is not Serializable.

If the panel is to simulate standard input it must be instantiated before standard input is accessed. Otherwise the reader might be waiting for a different stream.

See Also:
  • Field Details

    • nFrames

      protected static int nFrames
      counts instances to exit on last close.
    • IN

      public static final int IN
      trap System.in.
      See Also:
    • OUT

      public static final int OUT
      See Also:
    • panel

      protected yyAnimPanel panel
      input, stack, and comments.
    • eventThread

      protected Thread eventThread
      set by the checkbox listener.
    • outputBreak

      protected boolean outputBreak
      breakpoint, only(!) set in GUI.
  • Constructor Details

    • yyAnim

      public yyAnim(String title, int io)
      creates and displays the frame.
      Parameters:
      io - flags to trap standard input, and/or standard and diagnostic output.
    • yyAnim

      public yyAnim(Class system, String title, int io)
      creates and displays the frame.
      Parameters:
      system - hook to spoof System.
      io - flags to trap standard input, and/or standard and diagnostic output.
  • Method Details

    • setStaggeredLocation

      public static void setStaggeredLocation(Component c)
      try to cascade multiple instances of components.
    • 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.
    • 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.
    • 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
    • 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.
    • 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.
    • 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.