internal override void SemanticValidation(Semantic.SemanticContext semanticContext) { foreach (var expr in this.Exprlist) { expr.SemanticValidation(semanticContext); } }
internal override void SemanticValidation(Semantic.SemanticContext semanticContext) { /* Expression.SemanticValidation(semanticContext); * if (!(Expression.GetIRType() is NumericType)) * { * throw new Semantic.SemanticValidationException("No se puede PostIncrement"); * } * else * returnType = new IntType();*/ }
internal override void SemanticValidation(Semantic.SemanticContext semanticContext) { Expression.SemanticValidation(semanticContext); if (!(Expression.GetIRType() is NumericType)) { throw new Semantic.SemanticValidationException("No se puede PreDecrement"); } else { returnType = new IntType(); } }
internal override void SemanticValidation(Semantic.SemanticContext semanticContext) { Expression.SemanticValidation(semanticContext); if (!(Expression.GetIRType() is BoolType)) { throw new Semantic.SemanticValidationException("No se puede negar"); } else { returnType = new BoolType(); //a exp tiene que poder negarse } }
internal override void SemanticValidation(Semantic.SemanticContext semanticContext) { /* Left.SemanticValidation(semanticContext); * Right.SemanticValidation(semanticContext); * * if (!(Left.GetIRType() is NumericType && Right.GetIRType() is NumericType) || !(Left.GetIRType() == Right.GetIRType())) * { * throw new Semantic.SemanticValidationException("No se puede Comparar"); * } * else * { * returnType = new BoolType(); //evaluar cual tipo de podría asignar dependiendo de su tamanio * }*/ }
internal override void SemanticValidation(Semantic.SemanticContext semanticContext) { Left.SemanticValidation(semanticContext); Right.SemanticValidation(semanticContext); if (!(Left.GetIRType() is NumericType && Right.GetIRType() is NumericType)) { throw new Semantic.SemanticValidationException("No se puede asignar"); } else { returnType = Left.GetIRType(); //evaluar cual tipo de podría asignar dependiendo de su tamanio } }
internal override void SemanticValidation(Semantic.SemanticContext semanticContext) { Left.SemanticValidation(semanticContext); Right.SemanticValidation(semanticContext); if (!(Left.GetIRType() is NumericType && Right.GetIRType() is NumericType)) { throw new Semantic.SemanticValidationException("No se puede operar"); } else { returnType = Left.GetIRType(); } }
internal override void SemanticValidation(Semantic.SemanticContext semanticContext) { /*this.FunctionDeclaration = semanticContext.FunctionDeclarations.Where(f => { * bool match = true; * match = f.Id == this.Id && f.Parameters.Count == this.Parameters.Exprlist.Count; * if ( match ) * { * for (int i = 0; i < f.Parameters.Count; i++) * { * match = f.Parameters[i].Type == this.Parameters.Exprlist[i].GetIRType(); * if (!match) * break; * } * } * return match; * }).First();*/ }
internal override void SemanticValidation(Semantic.SemanticContext semanticContext) { // throw new NotImplementedException(); }
internal override void SemanticValidation(Semantic.SemanticContext semanticContext) { returnType = new FloatType(); }
internal override void SemanticValidation(Semantic.SemanticContext semanticContext) { }
internal override void SemanticValidation(Semantic.SemanticContext semanticContext) { this.Expression.SemanticValidation(semanticContext); }