Package relaxngcc

# Class NGCCGrammar

java.lang.Object
relaxngcc.NGCCGrammar

public class NGCCGrammar extends 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

Fields
Modifier and Type
Field
Description
`final String`
`globalBody`
globally effective <java-body> statements.
`final String`
`globalImportDecls`
globally effective import statements.
`final Grammar`
`grammar`
Parsed grammar.
`final String`
`packageName`
Package name to which generated classes should go.

## Constructor Summary

Constructors
Constructor
Description
`NGCCGrammar(Grammar g, String pkgName, String runtime, String globalImport, String globalBody)`

## Method Summary

Modifier and Type
Method
Description
`void`
`buildAutomaton()`
`void`
`dump(PrintStream strm)`
`void`
`dumpAutomata(File outDir)`
generates automaton gif files.
`String`
`getRuntimeTypeFullName()`
`String`
`getRuntimeTypeShortName()`
Gets the class name of the runtime type alone without the package name.
`ScopeInfo`
`getScopeInfo(Scope scope)`
`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 Details

### grammar

public final Grammar grammar
Parsed grammar.

### packageName

public final 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 String globalImportDecls
globally effective import statements.

### globalBody

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

## Constructor Details

### NGCCGrammar

public NGCCGrammar(Grammar g, String pkgName, String runtime, String globalImport, String globalBody)

## Method Details

### getRuntimeTypeShortName

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

### getRuntimeTypeFullName

public String getRuntimeTypeFullName()

### getScopeInfo

public ScopeInfo getScopeInfo(Scope scope)

### iterateScopeInfos

public Iterator iterateScopeInfos()

### buildAutomaton

public void buildAutomaton()

### dump

public void dump(PrintStream strm)

### dumpAutomata

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

### output

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

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