|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSFE.BOAL.Parser
public class Parser
Parser The straight-line input code with inputs and generic gate-descriptions has the following format:
(running line number) [output] input
or
(running line number) [output] gate arity n table [ 0..(2^n)-1 enumeration of 0/1 outputs ] inputs [ line-num1 .. line-numn ]
// outputs for each possible n-bit input
// n inputs, designated by line-number
Note: a line with a "gate name", of the form:
(running line) and line-num1 line-num2
is simply a macro, that expands into:
(running line) gate arity 2 table [ 0 0 0 1 ] inputs [ line-num1 line-num2 ]
Explanation: The gate has 2 inputs; The output enumeration is:
00 : output 0
01 : output 0
10 : output 0
11 : output 1
Nested Class Summary | |
---|---|
class |
Parser.ParseError
|
Constructor Summary | |
---|---|
Parser(java.io.StreamTokenizer st)
Constructor for class Parser |
Method Summary | |
---|---|
Circuit |
getCircuit()
getCircuit returns the circuit that the parser builds. |
static void |
main(java.lang.String[] args)
A main program for testing the parser in standalone mode. |
void |
parse()
The parse() method is the main body of the parser. |
static void |
parserUsage()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Parser(java.io.StreamTokenizer st)
st
- - a StreamTokenizer that this parser operates on.Method Detail |
---|
public void parse() throws Parser.ParseError
-
- ParseError.
Parser.ParseError
public Circuit getCircuit()
public static void parserUsage()
public static void main(java.lang.String[] args)
args
- - command line arguments.
args[0] should be circuit filename
args[1] should be format filename
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |