fri.patterns.interpreter.parsergenerator.util
Class SemanticSkeletonGenerator

java.lang.Object
  |
  +--fri.patterns.interpreter.parsergenerator.util.SemanticSkeletonGenerator

public class SemanticSkeletonGenerator
extends java.lang.Object

This class can be called using SourceGenerator by commandline.

Generates Java code that contains empty method bodies for the implementation of a given Syntax. For every rule there will be a method with the name of the nonterminal on the left side and one argument for each symbol on the right side. All arguments are of type Object. The created implementation derives ReflectSemantic.

                File in = new File("MySyntax.grammar);
                String basename = "MySemantic";
                Writer out = new FileWriter(basename+".java");
                new SemanticSkeletonGenerator(in, basename, "my.pkg.name", out);
                // the Java source "my/pkg/name/MySemantic.java" will be generated
        

Author:
(c) 2002, Fritz Ritzberger
See Also:
ReflectSemantic, SourceGenerator

Constructor Summary
SemanticSkeletonGenerator(Syntax syntax, java.lang.String className, java.lang.String pkgName, java.io.Writer skeletonOutput)
          Reads the passed Syntax and turns it into a semantic skeleton implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SemanticSkeletonGenerator

public SemanticSkeletonGenerator(Syntax syntax,
                                 java.lang.String className,
                                 java.lang.String pkgName,
                                 java.io.Writer skeletonOutput)
                          throws java.lang.Exception
Reads the passed Syntax and turns it into a semantic skeleton implementation. The passed Write will be closed.

Parameters:
syntax - Syntax the semantc is meant for
className - basname of the class to generate (without package)
pkgName - name of package, can be null
skeletonOutput - Writer where Java source should be written to