dk.brics.grammar.parser
Class String2Grammar

java.lang.Object
  extended by dk.brics.grammar.parser.String2Grammar

public class String2Grammar
extends Object

Converter from grammar files to Grammars.


Constructor Summary
String2Grammar()
          Constructs a new converter.
 
Method Summary
 Grammar convert(String grammar, String file, PrintWriter out)
          Constructs grammar object from textual representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

String2Grammar

public String2Grammar()
Constructs a new converter.

Method Detail

convert

public Grammar convert(String grammar,
                       String file,
                       PrintWriter out)
                throws ParseException,
                       GrammarException
Constructs grammar object from textual representation.

Parameters:
grammar - textual representation of grammar
file - path or URL of grammar (null if unknown)
out - grammar warnings are printed to this stream if non-null (see AST2Grammar.convert(AST,PrintWriter)), if verbose mode then other messages are also printed here (if null, System.out is used)
Returns:
grammar object
Throws:
ParseException - if grammar is not syntactically correct according to meta.cfg
GrammarException - if grammar is invalid for other reasons


Copyright © 2005-2008 Anders Møller.