orc.parser
Class OrcParser

java.lang.Object
  extended by orc.parser.OrcParser

public class OrcParser
extends java.lang.Object

Interface to the parser. This isolates other code from the underlying parser technology.

Author:
quark

Constructor Summary
OrcParser(Config config, java.io.Reader reader)
           
OrcParser(Config config, java.io.Reader reader, java.lang.String filename)
          If you know the filename, it can be used to improve parse error messages.
 
Method Summary
static void main(java.lang.String[] args)
          For testing purposes; parses a program from stdin or a file given as an argument, and prints the parsed program.
 java.util.List<Declaration> parseModule()
          Parse the input as a module (declarations only).
 Expression parseProgram()
          Parse the input as a complete program (declarations plus goal expression).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrcParser

public OrcParser(Config config,
                 java.io.Reader reader)

OrcParser

public OrcParser(Config config,
                 java.io.Reader reader,
                 java.lang.String filename)
If you know the filename, it can be used to improve parse error messages.

Method Detail

parseProgram

public Expression parseProgram()
                        throws ParsingException,
                               java.io.IOException
Parse the input as a complete program (declarations plus goal expression).

Throws:
ParsingException
java.io.IOException

parseModule

public java.util.List<Declaration> parseModule()
                                        throws ParsingException,
                                               java.io.IOException
Parse the input as a module (declarations only).

Throws:
ParsingException
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException,
                        ParsingException
For testing purposes; parses a program from stdin or a file given as an argument, and prints the parsed program.

Throws:
java.io.IOException
ParsingException