Run Code | API | Code Wall | Misc | Feedback | Login | Theme | Privacy | Patreon |
C# Abstract Syntax Tree Example: Compiler for a numeric expressionInput an expression, for example: (2.11*-3*(5+7.18+9.23))+---1+++(-+-+--(1+2))*(-+-3+4)*(5+6)+3*(2+1) Tree graph: ┌── 2.11 ┌── (*) │ └── (-) │ └── 3 ┌── (*) │ │ ┌── 5 │ │ ┌── (+) │ │ │ └── 7.18 │ └── (+) │ └── 9.23 ┌── (+) │ └── (-) │ └── (-) │ └── (-) │ └── 1 ┌── (+) │ │ ┌── (+) │ │ │ └── (+) │ │ │ └── (-) │ │ │ └── (+) │ │ │ └── (-) │ │ │ └── (+) │ │ │ └── (-) │ │ │ └── (-) │ │ │ │ ┌── 1 │ │ │ └── (+) │ │ │ └── 2 │ │ ┌── (*) │ │ │ │ ┌── (-) │ │ │ │ │ └── (+) │ │ │ │ │ └── (-) │ │ │ │ │ └── 3 │ │ │ └── (+) │ │ │ └── 4 │ └── (*) │ │ ┌── 5 │ └── (+) │ └── 6 ── (+) │ ┌── 3 └── (*) │ ┌── 2 └── (+) └── 1 Value: -1041679 Lisp form: (+ (+ (+ (* (* 2.11 (- 3)) (+ (+ 5 7.18) 9.23)) (- (- (- 1)))) (* (* (+ (+ (- (+ (- (+ (- (- (+ 1 2))))))))) (+ (- (+ (- 3))) 4)) (+ 5 6))) (* 3 (+ 2 1))) |
λ
.NET NoSQL database for rapid development
|