internal static GrapeVariable Create(GrapeSimpleType type, GrapeIdentifier name) { GrapeVariable variable = new GrapeVariable(type, name); variable.InitializeFromTemplate(type); variable.InitializeFromChildren(type.FileName, new GrapeEntity[] {type, name}); return variable; }
public GrapeMethod(GrapeList<GrapeModifier> modifiers, GrapeType returnType, GrapeIdentifier name, GrapeList<GrapeParameter> parameters, GrapeList<GrapeStatement> body) : base(modifiers) { this.returnType = returnType; this.name = name.Name; this.parameters = parameters.ToList(this).AsReadOnly(); this.body = body.ToList(this).AsReadOnly(); }
internal static GrapeCallExpression Create(GrapeIdentifier identifier, GrapeList<GrapeExpression> parameters, GrapeAccessExpression next) { List<GrapeEntity> children = new List<GrapeEntity>(); children.Add(identifier); children.AddRange(parameters.Enumerate()); GrapeCallExpression result = new GrapeCallExpression(identifier, parameters, next); result.InitializeFromTemplate(identifier); result.InitializeFromChildren(identifier.FileName, children); return result; }
internal static GrapeMemberExpression Create(GrapeAccessExpressionType type, GrapeIdentifier identifier, GrapeAccessExpression next) { if (identifier == null) { throw new ArgumentNullException("identifier"); } Debug.Assert((type == GrapeAccessExpressionType.Root) || (type == GrapeAccessExpressionType.Field)); GrapeMemberExpression result = new GrapeMemberExpression(type, identifier, next); result.InitializeFromTemplate(identifier); return result; }
public GrapeClass(GrapeList<GrapeModifier> modifiers, GrapeIdentifier identifier, GrapeOptional<GrapeLiteralExpression<int>> size, GrapeOptional<GrapeSimpleType> inherits, GrapeList<GrapeClassItem> classItems) : base(modifiers) { GrapeLiteralExpression<int> sizeLiteral = size; this.size = (sizeLiteral == null) ? default(int?) : sizeLiteral.Value; this.inherits = inherits; this.classItems = classItems.ToList(this).AsReadOnly(); name = identifier.Name; }
protected override GrapeAccessExpression ToExpression(GrapeIdentifier identifier, GrapeAccessExpression next) { return GrapeCallExpression.Create(identifier, parameters, next); }
protected virtual GrapeAccessExpression ToExpression(GrapeIdentifier identifier, GrapeAccessExpression next) { return GrapeMemberExpression.Create((identifiers.Count == 1) && (ofMember == null) ? GrapeAccessExpression.GrapeAccessExpressionType.Root : GrapeAccessExpression.GrapeAccessExpressionType.Field, identifier, next); }
public GrapeMethod(GrapeList<GrapeModifier> modifiers, GrapeIdentifier name, GrapeList<GrapeParameter> parameters, GrapeList<GrapeStatement> body) : this(modifiers, null, name, parameters, body) { }
private GrapeCallExpression(GrapeIdentifier identifier, GrapeList<GrapeExpression> parameters, GrapeAccessExpression next): base(GrapeAccessExpressionType.Method, identifier, next) { this.parameters = parameters.ToList(this).AsReadOnly(); }
protected GrapeMemberExpression(GrapeAccessExpressionType type, GrapeIdentifier identifier, GrapeAccessExpression next): base(next) { Debug.Assert(type != GrapeAccessExpressionType.Array); this.type = type; this.identifier = identifier; }
public GrapeConstructor(GrapeList<GrapeModifier> modifiers, GrapeIdentifier name, GrapeList<GrapeParameter> parameters, GrapeList<GrapeStatement> body): base(modifiers, name, parameters, body) {}
public GrapeCatchClause(GrapeSimpleType exceptionType, GrapeIdentifier variableIdentifier, GrapeList<GrapeStatement> statements): base(statements) { this.exceptionType = exceptionType; exceptionVariable = GrapeVariable.Create(exceptionType, variableIdentifier); }
public GrapeVariable(GrapeType type, GrapeIdentifier name, GrapeInitializer initializer) { this.name = name.Name; this.type = type; this.initializer = initializer; }
public GrapeVariable(GrapeType type, GrapeIdentifier name) : this(type, name, null) { }
public GrapeParameter(GrapeType type, GrapeIdentifier name) : base(type, name, null) { }
public GrapeDestructor(GrapeList<GrapeModifier> modifiers, GrapeIdentifier name, GrapeList<GrapeStatement> body): base(modifiers, name, null, body) {}