Simple interpreter built on top of dg.js API as a PoC for deep embedding. See commands to create geometry.
Interpreter
"
;" evaluates expression.
Geometry Objects
Object Properties
Commands
- Variable -> [a-zA-Z]+
- Point -> Variable = (Number, Number);
- Midpoint -> Variable = Midpoint(Point, Point);
| Variable = Midpoint(Segment);
- Line -> Variable = Line(Point, Point);
- Segment -> Variable = Segment(Point, Point);
- Circle -> Variable = Circle(Point, Point);
- Tangent -> Variable = Tangent(Point, Circle);
- ParallelLine -> Variable = ParallelLine(Point, Line);
- PerpendicularLine -> Variable = PerpendicularLine(Point, Line);
- PerpendicularBisector -> Variable = PerpendicularBisector(Segment);
- AngleBisector -> Variable = AngleBisector(Point,Point,Point);
- Angle -> Variable = Angle(Point,Point,Point);
- Polygon -> Variable = Polygon([ Point,Point ],Number);
| Variable = Polygon([ Point,Point,Point, ...] );
- Function -> Variable = Function(String, Function);
- GeomObject -> Variable = Intersect(GeomObject, GeomObject);
Generated code in javascript using dg.js lib.