コード例 #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
     });
 }
コード例 #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
     });
 }
コード例 #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
     });
 }
コード例 #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
     });
 }
コード例 #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
     });
 }
コード例 #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
     });
 }
コード例 #7
0
 public static SemanticError CycleInTypeDeclaration(string type, TigerNode node)
 {
     return(new SemanticError()
     {
         Message = string.Format("Cycle detected defininig type '{0}'.", type),
         Node = node
     });
 }
コード例 #8
0
 internal static SemanticError InvalidUseOfAssignmentToAReadonlyVariable(TigerNode node)
 {
     return(new SemanticError()
     {
         Message = string.Format("Invalid use of assignment to a readonly variable."),
         Node = node
     });
 }
コード例 #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
     });
 }
コード例 #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
     });
 }
コード例 #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
     });
 }
コード例 #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
     });
 }
コード例 #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
     });
 }
コード例 #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
     });
 }
コード例 #15
0
 public static SemanticError ProcedureCannotReturn(string name, TigerNode node)
 {
     return(new SemanticError()
     {
         Message = string.Format("Procedure '{0}' cannot return.", name),
         Node = node
     });
 }
コード例 #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
     });
 }
コード例 #17
0
 public static SemanticError FunctionMustReturn(string name, TigerNode node)
 {
     return(new SemanticError()
     {
         Message = string.Format("Function '{0}' must return.", name),
         Node = node
     });
 }
コード例 #18
0
 public static SemanticError UndefinedVariableUsed(string name, TigerNode node)
 {
     return(new SemanticError
     {
         Message = string.Format("Variable '{0}' does not exist.", name),
         Node = node
     });
 }
コード例 #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
     });
 }
コード例 #20
0
 public static SemanticError FunctionDoesNotExist(string name, TigerNode node)
 {
     return(new SemanticError
     {
         Message = string.Format("Function '{0}' does not exist.", name),
         Node = node
     });
 }
コード例 #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
     });
 }