Add initial typechecker for AST #2
10
src/Ast.hs
10
src/Ast.hs
@ -24,10 +24,7 @@ data StatementExpression
|
|||||||
| ConstructorCall DataType [Expression]
|
| ConstructorCall DataType [Expression]
|
||||||
| MethodCall Expression Identifier [Expression]
|
| MethodCall Expression Identifier [Expression]
|
||||||
| TypedStatementExpression DataType StatementExpression
|
| TypedStatementExpression DataType StatementExpression
|
||||||
| PostIncrement Expression
|
| UnaryOperation UnaryOperator Expression
|
||||||
| PostDecrement Expression
|
|
||||||
| PreIncrement Expression
|
|
||||||
| PreDecrement Expression
|
|
||||||
deriving (Show, Eq)
|
deriving (Show, Eq)
|
||||||
|
|
||||||
data BinaryOperator
|
data BinaryOperator
|
||||||
@ -53,6 +50,10 @@ data BinaryOperator
|
|||||||
data UnaryOperator
|
data UnaryOperator
|
||||||
= Not
|
= Not
|
||||||
| Minus
|
| Minus
|
||||||
|
| PostIncrement Expression
|
||||||
|
| PostDecrement Expression
|
||||||
|
| PreIncrement Expression
|
||||||
|
| PreDecrement Expression
|
||||||
deriving (Show, Eq)
|
deriving (Show, Eq)
|
||||||
|
|
||||||
data Expression
|
data Expression
|
||||||
@ -64,7 +65,6 @@ data Expression
|
|||||||
| LocalVariable Identifier
|
| LocalVariable Identifier
|
||||||
| FieldVariable Identifier
|
| FieldVariable Identifier
|
||||||
| BinaryOperation BinaryOperator Expression Expression
|
| BinaryOperation BinaryOperator Expression Expression
|
||||||
| UnaryOperation UnaryOperator Expression
|
|
||||||
| StatementExpressionExpression StatementExpression
|
| StatementExpressionExpression StatementExpression
|
||||||
| TypedExpression DataType Expression
|
| TypedExpression DataType Expression
|
||||||
deriving (Show, Eq)
|
deriving (Show, Eq)
|
||||||
|
Loading…
Reference in New Issue
Block a user