public ArgInfo (int idx, UserType type, ArgCount count, string name, bool is_default, bool is_ordered) { Idx = idx; Type = type; Count = count; Name = name; switch (count) { case ArgCount.ZeroOrMore: Flags = new CodeBinaryOperatorExpression (Optional, Or, Multi); break; case ArgCount.OneOrMore: Flags = Multi; break; case ArgCount.Optional: Flags = Optional; break; case ArgCount.Standard: Flags = Standard; break; default: throw new Exception ("Unsupported ArgCount kind " + Count.ToString ()); } if (is_ordered) { Flags = new CodeBinaryOperatorExpression (Flags, Or, Ordered); if (is_default) Flags = new CodeBinaryOperatorExpression (Flags, Or, DefOrd); } else if (is_default) { Flags = new CodeBinaryOperatorExpression (Flags, Or, Default); } }
/// <summary> /// Constructs a single intrinsic definition. /// </summary> /// <param name="count">Indicates how many arguments the function takes</param> /// <param name="types">Bitmask representing the valid argument types</param> /// <param name="requiredType">Type to which the argument must be cast</param> /// <param name="returnType">Symbol representing the return type</param> public IntrDefinition(ArgCount count, int types, SymType requiredType, SymType returnType) { Count = count; Types = types; RequiredType = requiredType; ReturnType = returnType; }
public ArgInfo(int idx, UserType type, ArgCount count, string name, bool is_default, bool is_ordered) { Idx = idx; Type = type; Count = count; Name = name; switch (count) { case ArgCount.ZeroOrMore: Flags = new CodeBinaryOperatorExpression(Optional, Or, Multi); break; case ArgCount.OneOrMore: Flags = Multi; break; case ArgCount.Optional: Flags = Optional; break; case ArgCount.Standard: Flags = Standard; break; default: throw new Exception("Unsupported ArgCount kind " + Count.ToString()); } if (is_ordered) { Flags = new CodeBinaryOperatorExpression(Flags, Or, Ordered); if (is_default) { Flags = new CodeBinaryOperatorExpression(Flags, Or, DefOrd); } } else if (is_default) { Flags = new CodeBinaryOperatorExpression(Flags, Or, Default); } }
public void AddTargetArgument(ArgCount count, string name, bool is_default, bool is_ordered) { if (count == ArgCount.Standard) { target_arg_reqd = true; } else if (count == ArgCount.Optional) { target_arg_reqd = false; } else { throw new Exception("A .target argument cannot be multiple-valued"); } if (is_ordered) { throw new Exception("A .target argument cannot be ordered"); } target_arg_name = name; }
public void AddArgument(UserType type, ArgCount count, string name, bool is_default, bool is_ordered) { arguments.Add(new ArgInfo(arguments.Count, type, count, name, is_default, is_ordered)); }
public void AddTargetArgument (ArgCount count, string name, bool is_default, bool is_ordered) { if (count == ArgCount.Standard) target_arg_reqd = true; else if (count == ArgCount.Optional) target_arg_reqd = false; else throw new Exception ("A .target argument cannot be multiple-valued"); if (is_ordered) throw new Exception ("A .target argument cannot be ordered"); target_arg_name = name; }
public void AddArgument (UserType type, ArgCount count, string name, bool is_default, bool is_ordered) { arguments.Add (new ArgInfo (arguments.Count, type, count, name, is_default, is_ordered)); }