Package relaxngcc.grammar

# Class Grammar

java.lang.Object
relaxngcc.grammar.Pattern
relaxngcc.grammar.Scope
relaxngcc.grammar.Grammar

public final class Grammar extends Scope
Set of `Scope`s.

Grammar as `Scope` holds information about the start pattern. This allows us to easily recognize Grammar in the parsed tree.

Author:
  Kohsuke Kawaguchi (kk@kohsuke.org)

## Field Summary

Fields
Modifier and Type
Field
Description
`final Grammar`
`parent`
Parent `Grammar` object, if any.

### Fields inherited from class relaxngcc.grammar.Scope

`name`

## Constructor Summary

Constructors
Constructor
Description
`Grammar(ParserRuntime rt)`

## Method Summary

Modifier and Type
Method
Description
`Scope`
`get(String name)`
Gets the Scope object or return null.
`Scope`
`getOrCreate(ParserRuntime rt, String name)`
`Iterator`
`iterateScopes()`
Iterates all the named `Scope`s in this grammar.
`Scope`
`redefine(ParserRuntime rt, String name)`

### Methods inherited from class relaxngcc.grammar.Scope

`append, appendBody, appendImport, apply, clear, getBody, getImport, getParam, getParamCount, getPattern, setParam`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### parent

public final Grammar parent
Parent `Grammar` object, if any. Otherwise null.

## Constructor Details

### Grammar

public Grammar(ParserRuntime rt)

## Method Details

### get

public Scope get(String name)
Gets the Scope object or return null.

### getOrCreate

public Scope getOrCreate(ParserRuntime rt, String name)

### redefine

public Scope redefine(ParserRuntime rt, String name)

### iterateScopes

public Iterator iterateScopes()
Iterates all the named `Scope`s in this grammar.