Testing lexer
This commit is contained in:
parent
9c17f64eaa
commit
5e686d246a
3893
compiler.py
3893
compiler.py
File diff suppressed because it is too large
Load Diff
|
|
@ -13,11 +13,11 @@ R = 7;
|
||||||
r = 4;
|
r = 4;
|
||||||
d = 1;
|
d = 1;
|
||||||
|
|
||||||
ANIM offset {R:0 <= x <= 8*pi,S:π/128}
|
ANIM offset {R:0 <= x <= 8*π,S:π/128}
|
||||||
|
|
||||||
GRAPH {
|
GRAPH {
|
||||||
X: (R - r) * cos(t) + d * cos(((R - r) / r) * t),
|
X: (R - r) * cos(t) + d * cos(((R - r) / r) * t),
|
||||||
Y: (R - r) * sin(t) - d * sin(((R - r) / r) * t),
|
Y: (R - r) * sin(t) - d * sin(((R - r) / r) * t),
|
||||||
T: ANIM {R:0+offset <= x <= 8*pi+offset,S:π/32},
|
T: ANIM {R:0+offset <= x <= 8*π+offset,S:π/32},
|
||||||
C_w: ((t - r[0]) / (r[1] - r[0]))
|
C_w: ((t - r[0]) / (r[1] - r[0]))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,162 @@
|
||||||
|
Type: Identifier, Value: SCREEN
|
||||||
|
Type: Punctuation, Value: {
|
||||||
|
Type: Identifier, Value: Width
|
||||||
|
Type: Identifier, Value: Scale
|
||||||
|
Type: Punctuation, Value: :
|
||||||
|
Type: NumberLiteral, Value: 100
|
||||||
|
Type: Punctuation, Value: ,
|
||||||
|
Type: Identifier, Value: Height
|
||||||
|
Type: Identifier, Value: Scale
|
||||||
|
Type: Punctuation, Value: :
|
||||||
|
Type: NumberLiteral, Value: 100
|
||||||
|
Type: Punctuation, Value: ,
|
||||||
|
Type: Identifier, Value: FPS
|
||||||
|
Type: Punctuation, Value: :
|
||||||
|
Type: NumberLiteral, Value: 60
|
||||||
|
Type: Punctuation, Value: ,
|
||||||
|
Type: Punctuation, Value: }
|
||||||
|
Type: Identifier, Value: R
|
||||||
|
Type: Punctuation, Value: =
|
||||||
|
Type: NumberLiteral, Value: 7
|
||||||
|
Type: Punctuation, Value: ;
|
||||||
|
Type: Identifier, Value: r
|
||||||
|
Type: Punctuation, Value: =
|
||||||
|
Type: NumberLiteral, Value: 4
|
||||||
|
Type: Punctuation, Value: ;
|
||||||
|
Type: Identifier, Value: d
|
||||||
|
Type: Punctuation, Value: =
|
||||||
|
Type: NumberLiteral, Value: 1
|
||||||
|
Type: Punctuation, Value: ;
|
||||||
|
Type: Identifier, Value: ANIM
|
||||||
|
Type: Identifier, Value: offset
|
||||||
|
Type: Punctuation, Value: {
|
||||||
|
Type: Identifier, Value: R
|
||||||
|
Type: Punctuation, Value: :
|
||||||
|
Type: NumberLiteral, Value: 0
|
||||||
|
Type: Punctuation, Value: ≤
|
||||||
|
Type: Identifier, Value: x
|
||||||
|
Type: Punctuation, Value: ≤
|
||||||
|
Type: NumberLiteral, Value: 8
|
||||||
|
Type: Punctuation, Value: *
|
||||||
|
Type: Punctuation, Value: π
|
||||||
|
Type: Punctuation, Value: ,
|
||||||
|
Type: Identifier, Value: S
|
||||||
|
Type: Punctuation, Value: :
|
||||||
|
Type: Punctuation, Value: π
|
||||||
|
Type: Punctuation, Value: /
|
||||||
|
Type: NumberLiteral, Value: 128
|
||||||
|
Type: Punctuation, Value: }
|
||||||
|
Type: Identifier, Value: GRAPH
|
||||||
|
Type: Punctuation, Value: {
|
||||||
|
Type: Identifier, Value: X
|
||||||
|
Type: Punctuation, Value: :
|
||||||
|
Type: Punctuation, Value: (
|
||||||
|
Type: Identifier, Value: R
|
||||||
|
Type: Punctuation, Value: -
|
||||||
|
Type: Identifier, Value: r
|
||||||
|
Type: Punctuation, Value: )
|
||||||
|
Type: Punctuation, Value: *
|
||||||
|
Type: Identifier, Value: cos
|
||||||
|
Type: Punctuation, Value: (
|
||||||
|
Type: Identifier, Value: t
|
||||||
|
Type: Punctuation, Value: )
|
||||||
|
Type: Punctuation, Value: +
|
||||||
|
Type: Identifier, Value: d
|
||||||
|
Type: Punctuation, Value: *
|
||||||
|
Type: Identifier, Value: cos
|
||||||
|
Type: Punctuation, Value: (
|
||||||
|
Type: Punctuation, Value: (
|
||||||
|
Type: Punctuation, Value: (
|
||||||
|
Type: Identifier, Value: R
|
||||||
|
Type: Punctuation, Value: -
|
||||||
|
Type: Identifier, Value: r
|
||||||
|
Type: Punctuation, Value: )
|
||||||
|
Type: Punctuation, Value: /
|
||||||
|
Type: Identifier, Value: r
|
||||||
|
Type: Punctuation, Value: )
|
||||||
|
Type: Punctuation, Value: *
|
||||||
|
Type: Identifier, Value: t
|
||||||
|
Type: Punctuation, Value: )
|
||||||
|
Type: Punctuation, Value: ,
|
||||||
|
Type: Identifier, Value: Y
|
||||||
|
Type: Punctuation, Value: :
|
||||||
|
Type: Punctuation, Value: (
|
||||||
|
Type: Identifier, Value: R
|
||||||
|
Type: Punctuation, Value: -
|
||||||
|
Type: Identifier, Value: r
|
||||||
|
Type: Punctuation, Value: )
|
||||||
|
Type: Punctuation, Value: *
|
||||||
|
Type: Identifier, Value: sin
|
||||||
|
Type: Punctuation, Value: (
|
||||||
|
Type: Identifier, Value: t
|
||||||
|
Type: Punctuation, Value: )
|
||||||
|
Type: Punctuation, Value: -
|
||||||
|
Type: Identifier, Value: d
|
||||||
|
Type: Punctuation, Value: *
|
||||||
|
Type: Identifier, Value: sin
|
||||||
|
Type: Punctuation, Value: (
|
||||||
|
Type: Punctuation, Value: (
|
||||||
|
Type: Punctuation, Value: (
|
||||||
|
Type: Identifier, Value: R
|
||||||
|
Type: Punctuation, Value: -
|
||||||
|
Type: Identifier, Value: r
|
||||||
|
Type: Punctuation, Value: )
|
||||||
|
Type: Punctuation, Value: /
|
||||||
|
Type: Identifier, Value: r
|
||||||
|
Type: Punctuation, Value: )
|
||||||
|
Type: Punctuation, Value: *
|
||||||
|
Type: Identifier, Value: t
|
||||||
|
Type: Punctuation, Value: )
|
||||||
|
Type: Punctuation, Value: ,
|
||||||
|
Type: Identifier, Value: T
|
||||||
|
Type: Punctuation, Value: :
|
||||||
|
Type: Identifier, Value: ANIM
|
||||||
|
Type: Punctuation, Value: {
|
||||||
|
Type: Identifier, Value: R
|
||||||
|
Type: Punctuation, Value: :
|
||||||
|
Type: NumberLiteral, Value: 0
|
||||||
|
Type: Punctuation, Value: +
|
||||||
|
Type: Identifier, Value: offset
|
||||||
|
Type: Punctuation, Value: ≤
|
||||||
|
Type: Identifier, Value: x
|
||||||
|
Type: Punctuation, Value: ≤
|
||||||
|
Type: NumberLiteral, Value: 8
|
||||||
|
Type: Punctuation, Value: *
|
||||||
|
Type: Punctuation, Value: π
|
||||||
|
Type: Punctuation, Value: +
|
||||||
|
Type: Identifier, Value: offset
|
||||||
|
Type: Punctuation, Value: ,
|
||||||
|
Type: Identifier, Value: S
|
||||||
|
Type: Punctuation, Value: :
|
||||||
|
Type: Punctuation, Value: π
|
||||||
|
Type: Punctuation, Value: /
|
||||||
|
Type: NumberLiteral, Value: 32
|
||||||
|
Type: Punctuation, Value: }
|
||||||
|
Type: Punctuation, Value: ,
|
||||||
|
Type: Identifier, Value: C
|
||||||
|
Type: Punctuation, Value: _
|
||||||
|
Type: Identifier, Value: w
|
||||||
|
Type: Punctuation, Value: :
|
||||||
|
Type: Punctuation, Value: (
|
||||||
|
Type: Punctuation, Value: (
|
||||||
|
Type: Identifier, Value: t
|
||||||
|
Type: Punctuation, Value: -
|
||||||
|
Type: Identifier, Value: r
|
||||||
|
Type: Punctuation, Value: [
|
||||||
|
Type: NumberLiteral, Value: 0
|
||||||
|
Type: Punctuation, Value: ]
|
||||||
|
Type: Punctuation, Value: )
|
||||||
|
Type: Punctuation, Value: /
|
||||||
|
Type: Punctuation, Value: (
|
||||||
|
Type: Identifier, Value: r
|
||||||
|
Type: Punctuation, Value: [
|
||||||
|
Type: NumberLiteral, Value: 1
|
||||||
|
Type: Punctuation, Value: ]
|
||||||
|
Type: Punctuation, Value: -
|
||||||
|
Type: Identifier, Value: r
|
||||||
|
Type: Punctuation, Value: [
|
||||||
|
Type: NumberLiteral, Value: 0
|
||||||
|
Type: Punctuation, Value: ]
|
||||||
|
Type: Punctuation, Value: )
|
||||||
|
Type: Punctuation, Value: )
|
||||||
|
Type: Punctuation, Value: }
|
||||||
Loading…
Reference in New Issue