Typed AST elements
This commit is contained in:
parent
8d8bc06034
commit
88604bf544
@ -12,7 +12,7 @@ executable compiler
|
|||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
hs-source-dirs: src
|
hs-source-dirs: src
|
||||||
build-tool-depends: alex:alex, happy:happy
|
build-tool-depends: alex:alex, happy:happy
|
||||||
other-modules: Parser.Lexer
|
other-modules: Parser.Lexer, Ast
|
||||||
|
|
||||||
test-suite tests
|
test-suite tests
|
||||||
type: exitcode-stdio-1.0
|
type: exitcode-stdio-1.0
|
||||||
|
@ -15,10 +15,12 @@ data Statement = If Expression Statement (Maybe Statement)
|
|||||||
| Block [Statement]
|
| Block [Statement]
|
||||||
| Return (Maybe Expression)
|
| Return (Maybe Expression)
|
||||||
| StatementExpressionStatement StatementExpression
|
| StatementExpressionStatement StatementExpression
|
||||||
|
| TypedStatement DataType Statement
|
||||||
|
|
||||||
data StatementExpression = Assignment Identifier Expression
|
data StatementExpression = Assignment Identifier Expression
|
||||||
| ConstructorCall DataType [Expression]
|
| ConstructorCall DataType [Expression]
|
||||||
| MethodCall Identifier [Expression]
|
| MethodCall Identifier [Expression]
|
||||||
|
| TypedStatementExpression DataType StatementExpression
|
||||||
|
|
||||||
data BinaryOperator = Addition
|
data BinaryOperator = Addition
|
||||||
| Subtraction
|
| Subtraction
|
||||||
@ -48,4 +50,5 @@ data Expression = IntegerLiteral Int
|
|||||||
| BinaryOperation BinaryOperator Expression Expression
|
| BinaryOperation BinaryOperator Expression Expression
|
||||||
| UnaryOperation UnaryOperator Expression
|
| UnaryOperation UnaryOperator Expression
|
||||||
| StatementExpressionExpression StatementExpression
|
| StatementExpressionExpression StatementExpression
|
||||||
|
| TypedExpression DataType Expression
|
||||||
|
|
Loading…
Reference in New Issue
Block a user