Exemplo n.º 1
0
 internal static SemanticError InvalidUseOfUnaryMinusOperator(TigerNode node)
 {
     return(new SemanticError()
     {
         Message = string.Format("The expression of the unary minus operator must be an integer."),
         Node = node
     });
 }
Exemplo n.º 2
0
 internal static SemanticError TypeNoLongerVisible(TypeNode type, TigerNode node)
 {
     return(new SemanticError()
     {
         Message = string.Format("Type '{0}' is not longer visible at this scope.", type.Name),
         Node = node
     });
 }
Exemplo n.º 3
0
 internal static SemanticError InvalidArrayAccess(TigerNode node)
 {
     return(new SemanticError()
     {
         Message = string.Format("Invalid array access. Index expression must be of type int."),
         Node = node
     });
 }
Exemplo n.º 4
0
 public static SemanticError InvalidNumber(string literal, TigerNode node)
 {
     return(new SemanticError
     {
         Message = string.Format("'{0}' is not a valid number.", literal),
         Node = node
     });
 }
Exemplo n.º 5
0
 public static SemanticError FunctionUsedAsVariable(string name, TigerNode node)
 {
     return(new SemanticError
     {
         Message = string.Format("Function '{0}' used as variable or constant.", name),
         Node = node
     });
 }
Exemplo n.º 6
0
 public static SemanticError TypeDoesNotExist(string typeID, TigerNode node)
 {
     return(new SemanticError()
     {
         Message = string.Format("The type name '{0}' could not be found.", typeID),
         Node = node
     });
 }
Exemplo n.º 7
0
 public static SemanticError CycleInTypeDeclaration(string type, TigerNode node)
 {
     return(new SemanticError()
     {
         Message = string.Format("Cycle detected defininig type '{0}'.", type),
         Node = node
     });
 }
Exemplo n.º 8
0
 internal static SemanticError InvalidUseOfAssignmentToAReadonlyVariable(TigerNode node)
 {
     return(new SemanticError()
     {
         Message = string.Format("Invalid use of assignment to a readonly variable."),
         Node = node
     });
 }
Exemplo n.º 9
0
 public static SemanticError PreviousFieldDeclaration(string name, TigerNode node)
 {
     return(new SemanticError()
     {
         Message = string.Format("The field '{0}' is already defined in this record.", name),
         Node = node
     });
 }
Exemplo n.º 10
0
 public static SemanticError IdentifierExpectedKeywordGiven(string keyword, TigerNode node)
 {
     return(new SemanticError()
     {
         Message = string.Format("Identifier expected; '{0}' is a keyword.", keyword),
         Node = node
     });
 }
Exemplo n.º 11
0
 public static SemanticError PreviousTypeDeclaration(string name, TigerNode node)
 {
     return(new SemanticError()
     {
         Message = string.Format("A type '{0}' is already defined in this scope.", name),
         Node = node
     });
 }
Exemplo n.º 12
0
 public static SemanticError InvalidTypeInference(TypeNode type, TigerNode node)
 {
     return(new SemanticError()
     {
         Message = string.Format("Cannot assign <{0}> to an implicitly-typed variable.", type.Name),
         Node = node
     });
 }
Exemplo n.º 13
0
 public static SemanticError InvalidIntNilAssignation(TigerNode node)
 {
     return(new SemanticError()
     {
         Message = "Cannot convert null to 'int' because it is a non-nullable value type.",
         Node = node
     });
 }
Exemplo n.º 14
0
 internal static SemanticError IncompatibleTypesInIfThenElse(TigerNode node)
 {
     return(new SemanticError()
     {
         Message = string.Format("Expressions in if-then-else must be of the same type or both not return a value."),
         Node = node
     });
 }
Exemplo n.º 15
0
 public static SemanticError ProcedureCannotReturn(string name, TigerNode node)
 {
     return(new SemanticError()
     {
         Message = string.Format("Procedure '{0}' cannot return.", name),
         Node = node
     });
 }
Exemplo n.º 16
0
 internal static SemanticError ArrayTypeExpected(TypeNode type, TigerNode node)
 {
     return(new SemanticError()
     {
         Message = string.Format("Array type expected, type '{0}' given.", type.Name),
         Node = node
     });
 }
Exemplo n.º 17
0
 public static SemanticError FunctionMustReturn(string name, TigerNode node)
 {
     return(new SemanticError()
     {
         Message = string.Format("Function '{0}' must return.", name),
         Node = node
     });
 }
Exemplo n.º 18
0
 public static SemanticError UndefinedVariableUsed(string name, TigerNode node)
 {
     return(new SemanticError
     {
         Message = string.Format("Variable '{0}' does not exist.", name),
         Node = node
     });
 }
Exemplo n.º 19
0
 internal static SemanticError VariableMustHaveAType(string name, TigerNode node)
 {
     return(new SemanticError()
     {
         Message = string.Format("Cannot assign void expression to variable '{0}'.", name),
         Node = node
     });
 }
Exemplo n.º 20
0
 public static SemanticError FunctionDoesNotExist(string name, TigerNode node)
 {
     return(new SemanticError
     {
         Message = string.Format("Function '{0}' does not exist.", name),
         Node = node
     });
 }
Exemplo n.º 21
0
 public static SemanticError InvalidIndexingOperation(TypeNode type, TigerNode node)
 {
     return(new SemanticError
     {
         Message = string.Format("Cannot apply indexing with [] to an expression of type '{0}'.", type.Name),
         Node = node
     });
 }