How to use the Graphical Syntax Viewer

  1. Convert the productions of the grammar of the target language to the format that would be accepted by GrammarConverter.java.Let us call that ASCII file as gr.txt which contains regular expressions for the non-terminals along with other syntax diagrams.

  2. It is not necessary to compile all the files unless any of them have been updated or modified. If they have, then you may compile the java files - Diagram.java , Xdiagram.java , DecisionDiagram.java , Connector.java , EmptyDiagram.java , IfConnector.java , LoopConnector.java , LoopDiagram.java , NonTerminalDiagram.java , SequenceDiagram.java , SequentialLayout.java , TerminalDiagram.java , VerticalLayout.java , Regular.java .

  3. Compile GrammarConverter.java i,e. javac GrammarConverter.java .

  4. Run it i.e. java GrammarConverter gr.txt Grammar . Here Grammar indicates the name of the class to be created which throughout the discussion has been Grammar.java.

  5. Now compile CurryDiagram.java i.e., javac CurryDiagram.java . This is the applet class.

  6. This program can be executed in two ways

    1. As an applet -- Use appletviewer on the HTML file Curry.html i.e.,

      appletviewer Curry.html

    2. As an application -- Type the the following command at the prompt i.e.,

      java CurryDiagram