net.sourceforge.chaperon.model.grammar
Class GrammarFactory

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended bynet.sourceforge.chaperon.model.grammar.GrammarFactory
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class GrammarFactory
extends org.xml.sax.helpers.DefaultHandler

This class should generate a grammar from a SAX stream

Version:
CVS $Id: GrammarFactory.java,v 1.5 2003/12/14 09:48:34 benedikta Exp $
Author:
Stephan Michels

Field Summary
static java.lang.String ASSOCIATIVITY_ELEMENT
          Element name
static java.lang.String ERRORSYMBOL_ELEMENT
          Element name
static java.lang.String GRAMMAR_ELEMENT
          Element name
static java.lang.String NONTERMINALSYMBOL_ELEMENT
          Element name
static java.lang.String NS
          The namspace of the grammar configuration
static java.lang.String PRECEDENCE_ATTRIBUTE
          Attribute name of the Precedence property
static java.lang.String PRIORITY_ELEMENT
          Element name
static java.lang.String PRODUCTION_ELEMENT
          Element name
static java.lang.String STARTSYMBOL_ELEMENT
          Element name
static java.lang.String SYMBOL_ATTRIBUTE
          Attribute name
static java.lang.String TERMINALSYMBOL_ELEMENT
          Element name
static java.lang.String TYPE_ATTRIBUTE
          Attribute name of the associativity property
 
Constructor Summary
GrammarFactory()
           
 
Method Summary
 void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
          Receive notification of the end of an element.
 Grammar getGrammar()
          Returns the generated Grammar
 void setDocumentLocator(org.xml.sax.Locator locator)
          Receive an object for locating the origin of SAX document events.
 void startDocument()
          Receive notification of the beginning of a document.
 void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
          Receive notification of the beginning of an element.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NS

public static final java.lang.String NS
The namspace of the grammar configuration

See Also:
Constant Field Values

GRAMMAR_ELEMENT

public static final java.lang.String GRAMMAR_ELEMENT
Element name

See Also:
Constant Field Values

PRODUCTION_ELEMENT

public static final java.lang.String PRODUCTION_ELEMENT
Element name

See Also:
Constant Field Values

PRECEDENCE_ATTRIBUTE

public static final java.lang.String PRECEDENCE_ATTRIBUTE
Attribute name of the Precedence property

See Also:
Constant Field Values

NONTERMINALSYMBOL_ELEMENT

public static final java.lang.String NONTERMINALSYMBOL_ELEMENT
Element name

See Also:
Constant Field Values

TERMINALSYMBOL_ELEMENT

public static final java.lang.String TERMINALSYMBOL_ELEMENT
Element name

See Also:
Constant Field Values

ERRORSYMBOL_ELEMENT

public static final java.lang.String ERRORSYMBOL_ELEMENT
Element name

See Also:
Constant Field Values

STARTSYMBOL_ELEMENT

public static final java.lang.String STARTSYMBOL_ELEMENT
Element name

See Also:
Constant Field Values

PRIORITY_ELEMENT

public static final java.lang.String PRIORITY_ELEMENT
Element name

See Also:
Constant Field Values

ASSOCIATIVITY_ELEMENT

public static final java.lang.String ASSOCIATIVITY_ELEMENT
Element name

See Also:
Constant Field Values

TYPE_ATTRIBUTE

public static final java.lang.String TYPE_ATTRIBUTE
Attribute name of the associativity property

See Also:
Constant Field Values

SYMBOL_ATTRIBUTE

public static final java.lang.String SYMBOL_ATTRIBUTE
Attribute name

See Also:
Constant Field Values
Constructor Detail

GrammarFactory

public GrammarFactory()
Method Detail

getGrammar

public Grammar getGrammar()
Returns the generated Grammar

Returns:
Grammar

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Receive an object for locating the origin of SAX document events.


startDocument

public void startDocument()
Receive notification of the beginning of a document.


startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Receive notification of the beginning of an element.

Parameters:
namespaceURI - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
localName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
qName - The raw XML 1.0 name (with prefix), or the empty string if raw names are not available.
atts - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String namespaceURI,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Receive notification of the end of an element.

Parameters:
namespaceURI - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
localName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
qName - The raw XML 1.0 name (with prefix), or the empty string if raw names are not available.
Throws:
org.xml.sax.SAXException


Copyright ? 2003 Chaperon project. All Rights Reserved.