Commit 1d09a10a authored by Aliaume Lopez's avatar Aliaume Lopez

Correcting the parentheses problem

parent 8febad9f
let X = link a:b c:d for (a: | c:) . (:d | :b) in
let N = X . NMOS in
let P = X . PMOS in
let INV = (HIGH | FORK | LOW) . (P | NMOS) . JOIN in
let C = (FORK | FORK) . (INV | 3) . (1 | X | 1) . (PMOS | NMOS) . JOIN
in C
let NAND1 = (2 | LOW) . (1 | NMOS) . NMOS in
let NAND2 = (HIGH | 1 | HIGH | 1) . (NMOS | NMOS) . JOIN in
let NAND =
link a0:a1 b0:b1 c1:c0 for
PAR
(a0: | b0:) . :c0
(:a1 | :b1) . NAND1 . c1:
(:a1 | :b1) . NAND2 . c1:
END in
(HIGH | LOW) . NAND
......@@ -253,8 +253,8 @@ and parse_circ_name s i =
(* E *)
and parse_base s i =
begin
(parse_char '(' <*>> parse_parallel
<<*> parse_char ')')
(parse_char '(' <*>> (ign_space <*>> parse_parallel)
<<*> (ign_space <*>> parse_char ')'))
<|>
(pure id <*> parse_int)
<|>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment