Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 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();
 }
Esempio n. 3
0
		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;
		}
Esempio n. 5
0
 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;
 }
Esempio n. 6
0
		protected override GrapeAccessExpression ToExpression(GrapeIdentifier identifier, GrapeAccessExpression next) {
			return GrapeCallExpression.Create(identifier, parameters, next);
		}
Esempio n. 7
0
 protected virtual GrapeAccessExpression ToExpression(GrapeIdentifier identifier, GrapeAccessExpression next)
 {
     return GrapeMemberExpression.Create((identifiers.Count == 1) && (ofMember == null) ? GrapeAccessExpression.GrapeAccessExpressionType.Root : GrapeAccessExpression.GrapeAccessExpressionType.Field, identifier, next);
 }
Esempio n. 8
0
 public GrapeMethod(GrapeList<GrapeModifier> modifiers, GrapeIdentifier name, GrapeList<GrapeParameter> parameters, GrapeList<GrapeStatement> body)
     : this(modifiers, null, name, parameters, body)
 {
 }
Esempio n. 9
0
		private GrapeCallExpression(GrapeIdentifier identifier, GrapeList<GrapeExpression> parameters, GrapeAccessExpression next): base(GrapeAccessExpressionType.Method, identifier, next) {
			this.parameters = parameters.ToList(this).AsReadOnly();
		}
Esempio n. 10
0
		protected GrapeMemberExpression(GrapeAccessExpressionType type, GrapeIdentifier identifier, GrapeAccessExpression next): base(next) {
			Debug.Assert(type != GrapeAccessExpressionType.Array);
			this.type = type;
			this.identifier = identifier;
		}
Esempio n. 11
0
		public GrapeConstructor(GrapeList<GrapeModifier> modifiers, GrapeIdentifier name, GrapeList<GrapeParameter> parameters, GrapeList<GrapeStatement> body): base(modifiers, name, parameters, body) {}
Esempio n. 12
0
		public GrapeCatchClause(GrapeSimpleType exceptionType, GrapeIdentifier variableIdentifier, GrapeList<GrapeStatement> statements): base(statements) {
			this.exceptionType = exceptionType;
			exceptionVariable = GrapeVariable.Create(exceptionType, variableIdentifier);
		}
Esempio n. 13
0
 public GrapeVariable(GrapeType type, GrapeIdentifier name, GrapeInitializer initializer)
 {
     this.name = name.Name;
     this.type = type;
     this.initializer = initializer;
 }
Esempio n. 14
0
 public GrapeVariable(GrapeType type, GrapeIdentifier name)
     : this(type, name, null)
 {
 }
Esempio n. 15
0
 public GrapeParameter(GrapeType type, GrapeIdentifier name)
     : base(type, name, null)
 {
 }
Esempio n. 16
0
		public GrapeDestructor(GrapeList<GrapeModifier> modifiers, GrapeIdentifier name, GrapeList<GrapeStatement> body): base(modifiers, name, null, body) {}