[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Formatting ASCII text



A definition you say... therein lies the rub...
Hmm, still learning the names of things...

How about:
-State token (? ie. Next or Init) is aligned at column 1
-assignment operator "==" is  two spaces to right of state name
-arguments to assignment (i.e. IF, /\, \/)  are two columns right from assignment operator
-IF token is an argument to an assignment operator
-THEN token is two spaces to the right of the IF token, and on the next line after the IF arguments 
-ELSE token is two spaces to the right of the IF token, and on the next line after the THEN arguments
-token to token spacing would be a single space

Similar to:

SmallToBig == IF big + small <= 5

                THEN /\ big' = big + small

                    /\ small' = 0

                ELSE /\ big' = 5

                    /\ small' = small - (5 - big)


I would venture that your logic parser has a tree structure, and the indentation would roughly follow the tree level inside the parser.


Nick