relaxngcc
Class NGCCGrammar

java.lang.Object
  extended by relaxngcc.NGCCGrammar

public class NGCCGrammar
extends java.lang.Object

Keeps information about the global setting effective across the entire grammar.

A "grammar" in RELAX NG could be nested inside another grammar, so we need a bit different name. This class needs a better name.

Author:
Kohsuke Kawaguchi (kk@kohsuke.org)

Field Summary
 java.lang.String globalBody
          globally effective <java-body> statements.
 java.lang.String globalImportDecls
          globally effective import statements.
 Grammar grammar
          Parsed grammar.
 java.lang.String packageName
          Package name to which generated classes should go.
 
Constructor Summary
NGCCGrammar(Grammar g, java.lang.String pkgName, java.lang.String runtime, java.lang.String globalImport, java.lang.String globalBody)
           
 
Method Summary
 void buildAutomaton()
           
 void dump(java.io.PrintStream strm)
           
 void dumpAutomata(java.io.File outDir)
          generates automaton gif files.
 java.lang.String getRuntimeTypeFullName()
           
 java.lang.String getRuntimeTypeShortName()
          Gets the class name of the runtime type alone without the package name.
 ScopeInfo getScopeInfo(Scope scope)
           
 java.util.Iterator iterateScopeInfos()
           
 boolean output(Options opt, long sourceTimestamp)
          Generates the source code.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

grammar

public final Grammar grammar
Parsed grammar.


packageName

public final java.lang.String packageName
Package name to which generated classes should go. The value will be the empty string if the classes will be generated into the root package.


globalImportDecls

public final java.lang.String globalImportDecls
globally effective import statements.


globalBody

public final java.lang.String globalBody
globally effective <java-body> statements.

Constructor Detail

NGCCGrammar

public NGCCGrammar(Grammar g,
                   java.lang.String pkgName,
                   java.lang.String runtime,
                   java.lang.String globalImport,
                   java.lang.String globalBody)
Method Detail

getRuntimeTypeShortName

public java.lang.String getRuntimeTypeShortName()
Gets the class name of the runtime type alone without the package name.


getRuntimeTypeFullName

public java.lang.String getRuntimeTypeFullName()

getScopeInfo

public ScopeInfo getScopeInfo(Scope scope)

iterateScopeInfos

public java.util.Iterator iterateScopeInfos()

buildAutomaton

public void buildAutomaton()

dump

public void dump(java.io.PrintStream strm)

dumpAutomata

public void dumpAutomata(java.io.File outDir)
generates automaton gif files.


output

public boolean output(Options opt,
                      long sourceTimestamp)
               throws java.io.IOException,
                      NoDefinitionException
Generates the source code.

Returns:
true if files are in fact generated.
Throws:
java.io.IOException
NoDefinitionException