djfz-2021/thrax_example.grm
2022-01-02 21:42:46 +01:00

12 lines
433 B
Plaintext

# thraxcompiler --input_grammar=thrax_example.grm --output_far=example.far
# thraxrewrite-tester --far=example.far --rules=First
Zero = "0";
One = "1";
Bit = Zero | One;
export First = Optimize[Zero Zero* Bit* One One One One?];
export Second = Optimize[ (Zero One (One One)* )* | (One (One One)* Zero )* | Zero* | (Zero One (One One)* Zero )* ];
export Third = Optimize["a" (("b":"x")+ | ("c"+ : "y") | ("":"fric")) "a"];