dk.brics.grammar.parser
Class String2Grammar
java.lang.Object
dk.brics.grammar.parser.String2Grammar
public class String2Grammar
- extends Object
Converter from grammar files to Grammar
s.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
String2Grammar
public String2Grammar()
- Constructs a new converter.
convert
public Grammar convert(String grammar,
String file,
PrintWriter out)
throws ParseException,
GrammarException
- Constructs grammar object from textual representation.
- Parameters:
grammar
- textual representation of grammarfile
- 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.