All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class aioli.metal.Compile

java.lang.Object
   |
   +----antlr.Parser
           |
           +----antlr.LLkParser
                   |
                   +----aioli.metal.Compile

public class Compile
extends LLkParser
implements metalTokenTypes
This class is automatically generated by the antlr tool from the file metal.g. It compiles a metal file and generates a file formalism.java , that is in the packacke lang.language_name . To run the compiler just call
 java aioli.metal.Compile file.metal 
A metal specification starts with formalism of language_name is and ends with end . The body is composed of a list of declarations separated by semi colons. The possible declarations of operator are for star and plus list operators, fixed operatorm nullary operator, string atomic operator, integer atomic operator. They correspond to the different declaration:
env_list -> ENV * ...;
exp_list -> EXP + ...;
bin ->  EXP EXP ;
null -> ;
var -> implemented as STRING;
int -> implemented as INTEGER;
Phyla are presented as capital letters. A declaration enumarates the elements that a phylum includes (operators and phyla)
BEXP := int var;
EXP :=  bin null BEXP;
Finally here is the complete definition of the toy language
formalism of toy is
TOP  ::= null1 null2 app var abs tlist ;
null1  -> ;
null2  -> ;
app  -> TOP TOP ;
abs  -> TOP TOP ;
var  -> implemented as STRING ;
tlist  -> TOP * ... ;
end 


Variable Index

 o _tokenNames
 o _tokenSet_0
 o _tokenSet_1
 o _tokenSet_2
 o _tokenSet_3
 o _tokenSet_4
 o _tokenSet_5
 o _tokenSet_6
 o _tokenSet_7

Constructor Index

 o Compile(TokenBuffer)
 o Compile(Tokenizer)

Method Index

 o atomic(String, Formalism)
 o id()
 o main(String[])
 o op()
 o phy_or_op(String, Formalism)
 o phylum()
 o program()
 o rule(Formalism)
 o sons(String, Formalism)

Variables

 o _tokenNames
 public static final String _tokenNames[]
 o _tokenSet_0
 public static final BitSet _tokenSet_0
 o _tokenSet_1
 public static final BitSet _tokenSet_1
 o _tokenSet_2
 public static final BitSet _tokenSet_2
 o _tokenSet_3
 public static final BitSet _tokenSet_3
 o _tokenSet_4
 public static final BitSet _tokenSet_4
 o _tokenSet_5
 public static final BitSet _tokenSet_5
 o _tokenSet_6
 public static final BitSet _tokenSet_6
 o _tokenSet_7
 public static final BitSet _tokenSet_7

Constructors

 o Compile
 public Compile(TokenBuffer tokenBuf)
 o Compile
 public Compile(Tokenizer lexer)

Methods

 o main
 public static void main(String args[]) throws Exception
 o program
 public final Formalism program() throws ParserException, IOException
 o id
 public final String id() throws ParserException, IOException
 o rule
 public final void rule(Formalism fm) throws ParserException, IOException
 o op
 public final String op() throws ParserException, IOException
 o sons
 public final void sons(String name,
                        Formalism fm) throws ParserException, IOException
 o phylum
 public final String phylum() throws ParserException, IOException
 o phy_or_op
 public final void phy_or_op(String name,
                             Formalism fm) throws ParserException, IOException
 o atomic
 public final void atomic(String name,
                          Formalism fm) throws ParserException, IOException

All Packages  Class Hierarchy  This Package  Previous  Next  Index