Beispiel #1
0
 /// <summary>
 /// Creates a new function declaration node
 /// </summary>
 /// <param name="name">The name of the function</param>
 /// <param name="primitive">The built-in function that the declaration refers to</param>
 /// <param name="returnType">The return type of the function</param>
 /// <param name="parameters">The parameters taken by the function</param>
 public FunctionDeclarationNode(string name, Primitive primitive, SimpleTypeDeclarationNode returnType, params (SimpleTypeDeclarationNode type, bool byRef)[] parameters)
 /// <summary>
 /// Creates a new built in constant
 /// </summary>
 /// <param name="name">The name of the constant</param>
 /// <param name="type">The type of the constant</param>
 public BuiltInConstDeclarationNode(string name, SimpleTypeDeclarationNode type)
 {
     Name       = name;
     EntityType = type;
 }
 /// <summary>
 /// Creates a new unary operation node
 /// </summary>
 /// <param name="name">The symbol for the operation</param>
 /// <param name="primitive">The built-in function that the declaration refers to</param>
 /// <param name="argumentType">The type of the operation argument</param>
 /// <param name="returnType">The return type of the operation</param>
 public UnaryOperationDeclarationNode(string name, Primitive primitive, SimpleTypeDeclarationNode argumentType, SimpleTypeDeclarationNode returnType)
 {
     Name      = name;
     Primitive = primitive;
     Type      = new FunctionTypeDeclarationNode(returnType, (argumentType, false));
 }
 /// <summary>
 /// Creates a new binary operation node
 /// </summary>
 /// <param name="name">The symbol for the operation</param>
 /// <param name="primitive">The built-in function that the declaration refers to</param>
 /// <param name="leftType">The type of the lefthand operand</param>
 /// <param name="rightType">The type of the righthand operand</param>
 /// <param name="returnType">The return type of the operation</param>
 public BinaryOperationDeclarationNode(string name, Primitive primitive, SimpleTypeDeclarationNode leftType, SimpleTypeDeclarationNode rightType, SimpleTypeDeclarationNode returnType)
 {
     Name      = name;
     Primitive = primitive;
     Type      = new FunctionTypeDeclarationNode(returnType, (leftType, false), (rightType, false));
 }