SFE.Compiler
Class SFECompiler

java.lang.Object
  extended by SFE.Compiler.SFECompiler

public class SFECompiler
extends java.lang.Object

The SFECompiler class takes an input stream and checks if it is compatible with the predefined language. It uses the class Tokenizer that gives tokens and their values.


Constructor Summary
SFECompiler(java.io.FileReader file)
          Creates a tokenizer that parses the given stream.
 
Method Summary
static void compile(java.lang.String fileName, boolean opt)
          A test program
 Program compileProgram()
          Compiles the all program: program <program-name> { <type declarations> <function declarations> }
static void main(java.lang.String[] args)
          A test program
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SFECompiler

public SFECompiler(java.io.FileReader file)
Creates a tokenizer that parses the given stream.

Parameters:
file - a FileReader object providing the input stream.
Method Detail

compileProgram

public Program compileProgram()
                       throws java.text.ParseException,
                              java.io.IOException
Compiles the all program: program <program-name> { <type declarations> <function declarations> }

Returns:
Program data structure that holds all the declarations and statements of the program
Throws:
java.io.IOException - - if an I/O error occurs.
java.text.ParseException - - if a parsing error occurs.

compile

public static void compile(java.lang.String fileName,
                           boolean opt)
                    throws java.io.IOException
A test program

Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
A test program

Throws:
java.io.IOException