Absyn
Class MiniJava

java.lang.Object
  extended by Absyn.MiniJava
Direct Known Subclasses:
MiniJava.Dec, MiniJava.Exp, MiniJava.Modifier, MiniJava.Name, MiniJava.Stm, MiniJava.Type, MiniJava.Unit

public abstract class MiniJava
extends java.lang.Object

Abstract Syntax Trees (ASTs)


Nested Class Summary
static class MiniJava.Dec
           
static class MiniJava.Exp
           
static class MiniJava.Modifier
           
static class MiniJava.Name
           
static class MiniJava.Print
          A visitor to print the abstract syntax trees.
static class MiniJava.Stm
           
static class MiniJava.Type
           
static class MiniJava.Unit
           
static class MiniJava.Visitor<Domain,Range>
           
 
Field Summary
protected  Token token
          Each AST node is associated with a source program location, represented by a line number and a column number.
 
Method Summary
abstract
<D,R> R
accept(MiniJava.Visitor<D,R> v, D d)
          Each AST node accepts a Visitor
 int column()
           
 int line()
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token

protected final Token token
Each AST node is associated with a source program location, represented by a line number and a column number. This is inferred from the token used in constructing the AST node.

Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException

line

public int line()
Returns:
line number

column

public int column()
Returns:
column number

accept

public abstract <D,R> R accept(MiniJava.Visitor<D,R> v,
                               D d)
Each AST node accepts a Visitor

Type Parameters:
D - the domain of the visitor (i.e., argument type)
R - the range of the visitor (i.e., result type)
Parameters:
v - the visitor
d - the visitor's argument
Returns:
the visitor's return value