Class LexerFrame

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class LexerFrame extends JFrame implements ActionListener
Swing application to graphically display the tokens produced by the lexer.
See Also:
  • Constructor Details

    • LexerFrame

      public LexerFrame()
      Constructor used when invoking as a standalone application
    • LexerFrame

      public LexerFrame(Reader reader)
      Constructor used when invoking for a specific file
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent ae)
      Specified by:
      actionPerformed in interface ActionListener
    • main

      public static void main(String[] args) throws Exception
      Opens the token viewer. With no arguments, shows an empty frame and an open button. With one argument, reads that file and displays its tokens. With more than one argument, logs usage: java LexerFrame [filename.ext] and exits with status 1. A failure to install the system look and feel is ignored. The file reader is not closed here.

      Opening the named file can fail with FileNotFoundException.

      Parameters:
      args - optional path of one script to display
      Throws:
      Exception