|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.ryerson.kclowes.digsim.ui.CircuitPreprocessor
public class CircuitPreprocessor
Preprocess a circuit description interpreting/expanding macros.
A circuit description to preprocess contains (BNF description):
description = defBlock | circuitBlock defBlock = 'defBlock' blockName blockArgs '\n' body 'enddef' blockName = sequence of printable characters EXCEPT whitespace blockArgs = arg* arg = formal name body = circuitBlock* circuitBlock = DEFINED IN CircuitParser (as block)
A comment can be added with '//'; the rest of the line is ignored.
Method Summary | |
---|---|
void |
expand(java.io.Reader in,
java.io.Writer out)
Expand a circuit description. |
static CircuitPreprocessor |
getInstance()
|
static void |
main(java.lang.String[] args)
The main method allows the CircuitPreprocessor to be used as an application. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static CircuitPreprocessor getInstance()
public void expand(java.io.Reader in, java.io.Writer out)
in
- The source of the circuit description.out
- Where the expansion is written.public static void main(java.lang.String[] args)
With no arguments, it works as a filter: a circuit description is read from stdin and its expansion is written to stdout.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |