private GenericConstraint BuildConstraintFromChain(string name, ConstraintChain chain, TokenPosition position) { // Extracted chain data. bool valueType = false; bool defCtor = false; Expression bases = null; // Iterator though the chains. while(chain != null) { // Get the chain base. if(chain.baseExpr != null) { Expression newBase = chain.baseExpr; newBase.SetNext(bases); bases = newBase; } // Check the value type and default constructor. valueType = valueType || chain.valueType; defCtor = defCtor || chain.defCtor; // Check the next chain. chain = chain.next; } // Create the generic constraint. return new GenericConstraint(name, valueType, defCtor, bases, position); }
public CompilerException(string what, TokenPosition position) : base(position.ToString() + ": " + what) { this.position = position; }
private void PrepareFile(AstNode content, string fileName) { // Use an special position. TokenPosition pos = new TokenPosition(fileName, -1, -1); // Create the file node. FileNode file = new FileNode(content, pos); // Add the file into the module node. moduleNode.AddFirst(file); }
public ArgTypeAndFlags(Expression type, TokenPosition position) : this(type, position, false) { }
public ArgTypeAndFlags(Expression type, TokenPosition position, bool isParams) : base(position) { this.type = type; this.isParams = isParams; }
public MemberFlagsAndMask(MemberFlags flags, TokenPosition position) : base(position) { this.flags = flags; this.mask = (MemberFlags)(~0); }
public MemberFlagsAndMask(MemberFlags flags, MemberFlags mask, TokenPosition position) : base(position) { this.flags = flags; this.mask = mask; }
void Error(TokenPosition position, string message) { throw new CompilerException(message, position); }
public TokenPosition(TokenPosition position) { this.fileName = position.fileName; this.line = position.line; this.column = position.column; }