Testing lexer

This commit is contained in:
Kyler Olsen 2024-04-05 12:21:27 -06:00
parent 9c17f64eaa
commit 5e686d246a
3 changed files with 2114 additions and 1945 deletions

File diff suppressed because it is too large Load Diff

View File

@ -13,11 +13,11 @@ R = 7;
r = 4;
d = 1;
ANIM offset {R:0 <= x <= 8*pi,S:π/128}
ANIM offset {R:0 <= x <= 8*π,S:π/128}
GRAPH {
X: (R - r) * cos(t) + d * cos(((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]))
}

162
tokens.txt Normal file
View File

@ -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: }