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