se.chalmers.cs.gf.parse
Interface Parser

All Known Implementing Classes:
ChartParser, ParseDecimal, ParseTree

public interface Parser

Interface for all parsers from text to abstract syntax.


Method Summary
 java.lang.String getName()
          Get the name of this parser.
 java.util.Collection<Tree> parse(java.lang.String str)
          Parse a string to zero or more abstract syntax trees the parsers default category.
 java.util.Collection<Tree> parse(java.lang.String str, java.lang.String cat)
          Parse a string to zero or more abstract syntax trees in the given category.
 boolean tryThisOne()
          Whether this parser should be used when trying to parse a string with different parsers.
 

Method Detail

parse

java.util.Collection<Tree> parse(java.lang.String str)
Parse a string to zero or more abstract syntax trees the parsers default category.


parse

java.util.Collection<Tree> parse(java.lang.String str,
                                 java.lang.String cat)
Parse a string to zero or more abstract syntax trees in the given category.

Parameters:
cat - The category to parse in. Note that the category name given here might not be identical to the one in the GF grammar, as the conversion to a context-free grammar can change the category name. Typically, for non-dependent categories, the GF source category "C" is translated to "C{}.s".

getName

java.lang.String getName()
Get the name of this parser.


tryThisOne

boolean tryThisOne()
Whether this parser should be used when trying to parse a string with different parsers. This can be used to exclude special parsers from such attempts.