org.modeshape.sequencer.ddl
Class DdlParsers

java.lang.Object
  extended by org.modeshape.sequencer.ddl.DdlParsers

@Immutable
public class DdlParsers
extends Object

A set of parsers capable of understanding DDL file content. This class can be used directly to create an AstNode tree representing nodes and properties for DDL statement components.

You can also provide an input or parent AstNode node as the starting point for your tree.

The parser is based on the SQL-92 and extended by specific dialects. These dialect-specific parsers provide db-specific parsing of db-specific statements of statement extensions, features or properties.


Nested Class Summary
protected static class DdlParsers.ScoredParser
           
 
Field Summary
static List<DdlParser> BUILTIN_PARSERS
           
 
Constructor Summary
DdlParsers()
          Create an instance that uses all of the built-in parsers.
DdlParsers(List<DdlParser> parsers)
          Create an instance that uses the supplied parsers, in order.
 
Method Summary
 AstNode parse(String ddl, String fileName)
          Parse the supplied DDL content and return the root node of the AST representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUILTIN_PARSERS

public static final List<DdlParser> BUILTIN_PARSERS
Constructor Detail

DdlParsers

public DdlParsers()
Create an instance that uses all of the built-in parsers.


DdlParsers

public DdlParsers(List<DdlParser> parsers)
Create an instance that uses the supplied parsers, in order.

Parameters:
parsers - the list of parsers; may be empty or null if the built-in parsers should be used
Method Detail

parse

public AstNode parse(String ddl,
                     String fileName)
              throws ParsingException
Parse the supplied DDL content and return the root node of the AST representation.

Parameters:
ddl - content string; may not be null
fileName - the approximate name of the file containing the DDL content; may be null if this is not known
Returns:
the root tree AstNode
Throws:
ParsingException - if there is an error parsing the supplied DDL content


Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.