]>
git.bts.cx Git - sun.git/blob - runtime/src/sun/tree/node.h
1 #ifndef SUN_TREE_NODE_H
2 #define SUN_TREE_NODE_H
4 #include <sun/tree/operator_type.h>
11 typedef struct SLTNode SLTNode
;
13 extern const char *sltNodeToString(SLTNode
*node
);
15 extern SLTNode
*sltNodeMakeIdentifier(const char *name
);
17 extern SLTNode
*sltNodeMakeBoolean(bool value
);
18 extern SLTNode
*sltNodeMakeInteger(int value
);
19 extern SLTNode
*sltNodeMakeRawInteger(int value
);
20 extern SLTNode
*sltNodeMakeFloat(float value
);
21 extern SLTNode
*sltNodeMakeString(const char *value
);
22 extern SLTNode
*sltNodeMakeKey(const char *value
);
24 extern SLTNode
*sltNodeMakeCompound(SLTNode
*expression
);
26 extern SLTNode
*sltNodeMakeArgument(SLTNode
*expression
);
28 extern SLTNode
*sltNodeMakeArrayAccess(SLTNode
*array
, SLTNode
*access
);
29 extern SLTNode
*sltNodeMakeMemberAccess(SLTNode
*type
, SLTNode
*access
);
31 extern SLTNode
*sltNodeMakeFunctionCall(SLTNode
*function
, SLTNode
*arguments
);
33 extern SLTNode
*sltNodeMakeUnaryOperation(SLTNode
*op
, SLTNode
*operand
);
34 extern SLTNode
*sltNodeMakeBinaryOperation(SLTNode
*op
, SLTNode
*lhs
, SLTNode
*rhs
);
36 extern SLTNode
*sltNodeMakeOperator(SLTOperatorType type
);
38 extern SLTNode
*sltNodeMakeAssignment(SLTNode
*target
, SLTNode
*source
);
40 extern SLTNode
*sltNodeMakeReturn(SLTNode
*expression
);
41 extern SLTNode
*sltNodeMakeSleep(void);
42 extern SLTNode
*sltNodeMakeBreak(void);
44 extern SLTNode
*sltNodeMakeForIteration(SLTNode
*initialExpression
, SLTNode
*preValidExpression
, SLTNode
*loopExpression
, SLTNode
*statement
);
45 extern SLTNode
*sltNodeMakeDoIteration(SLTNode
*postValidExpression
, SLTNode
*statement
);
46 extern SLTNode
*sltNodeMakeWhileIteration(SLTNode
*preValidExpression
, SLTNode
*statement
);
48 extern SLTNode
*sltNodeMakeSelection(SLTNode
*validExpression
, SLTNode
*validStatement
, SLTNode
*invalidStatement
);
50 extern SLTNode
*sltNodeMakeStatementBlock(SLTNode
*contents
);
52 extern SLTNode
*sltNodeMakeVariableDefinition(SLTNode
*type
, SLTNode
*identifier
, SLTNode
*defaultExpression
);
54 //extern SLTNode *sltNodeMakeTypeDefinition(SLTNode *identifier, SLTNode *dimension);
56 extern SLTNode
*sltNodeMakeUserDefinedTypeDefinition(SLTNode
*identifier
, SLTNode
*members
);
57 extern SLTNode
*sltNodeMakeUserDefinedTypeMemberDefinition(SLTNode
*type
, SLTNode
*identifier
);
59 extern SLTNode
*sltNodeMakeFunctionDefinition(SLTNode
*type
, SLTNode
*identifier
, SLTNode
*parameters
, SLTNode
*body
);
60 extern SLTNode
*sltNodeMakeFunctionParameterDefinition(SLTNode
*type
, SLTNode
*identifier
);
62 extern SLTNode
*sltNodeMakeModule(SLTNode
*statementsAndDefinitions
);
64 extern SLTNode
*sltNodeMakeSequence(SLTNode
*head
, SLTNode
*item
);