Example #1
0
 internal override void SemanticValidation(Semantic.SemanticContext semanticContext)
 {
     foreach (var expr in this.Exprlist)
     {
         expr.SemanticValidation(semanticContext);
     }
 }
Example #2
0
 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();*/
 }
Example #3
0
 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();
     }
 }
Example #4
0
 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
     }
 }
Example #5
0
 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
      * }*/
 }
Example #6
0
        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
            }
        }
Example #7
0
        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();
            }
        }
Example #8
0
 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();*/
 }
Example #9
0
 internal override void SemanticValidation(Semantic.SemanticContext semanticContext)
 {
     // throw new NotImplementedException();
 }
Example #10
0
 internal override void SemanticValidation(Semantic.SemanticContext semanticContext)
 {
     returnType = new FloatType();
 }
Example #11
0
 internal override void SemanticValidation(Semantic.SemanticContext semanticContext)
 {
 }
Example #12
0
 internal override void SemanticValidation(Semantic.SemanticContext semanticContext)
 {
     this.Expression.SemanticValidation(semanticContext);
 }