|
CS 536 Fall 2007, Project 5 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectErr
public class Err
Functions for printing error messages. Computer Sciences 536.
Method Summary | |
---|---|
static void |
badArgType(int line,
int column,
String text)
Prints an error message concerning an argument type mismatch. |
static void |
badIntLiteral(int line,
int column,
String text)
Prints an error message concerning an invalid integer literal (one whose value is larger than Integer.MAX_VALUE). |
static void |
badReturnType(int line,
int column,
String text)
Prints an error message concerning a bad type of return expression. |
static void |
complexExpression(int line,
int column)
Prints an error message concerning an expression that is too complex to compile. |
static void |
duplicateDeclaration(int line,
int column,
String text)
Prints an error message concerning a multiply declared identifier. |
static int |
errors()
Returns a count of the total number of errors thus far. |
static void |
functionOutParam(int line,
int column,
String text)
Prints an error message concerning an "out" or "in out" parameter in a function. |
static void |
invalidAssignment(int line,
int column)
Prints an error message concerning an attempt to assign incompatible types. |
static void |
invalidBound(int line,
int column,
String text)
Prints an error message concerning an invalid lower or upper bound in and array declaration. |
static void |
invalidCharacter(int line,
int column,
String text)
Prints an error message concerning an invalid input character. |
static void |
invalidRead(int line,
int column)
Prints an error message concerning an attempt to read a string. |
static void |
missingReturn(int line,
int column,
String text)
Prints an error message concerning a missing return value. |
static void |
nonBooleanExpression(int line,
int column)
Prints an error message concerning a non-boolean expression used where a boolean expression is required. |
static void |
nonIntegerBound(int line,
int column,
String text)
Prints an error message concerning a non-integer bound in a for statement. |
static void |
nonIntegerSubscript(int line,
int column,
String text)
Prints an error message concerning a non-integer expression used as a subscript. |
static void |
nonIntegerVariable(int line,
int column)
Prints an error message concerning a non-integer variable in a for statement. |
static void |
nonLValueArg(int line,
int column,
ProcDeclNode.Mode mode,
String text)
Prints an error message concerning a non-lvalue passed to an "out" or "in out" parameter. |
static void |
nonLValueLHS(int line,
int column)
Prints an error message concerning a non-lvalue on the left-hand side of an assignment statement. |
static void |
nonProcedureCall(int line,
int column,
String text)
Prints an error message concerning a statement that looks like a procedure call but does not name a valid procedure. |
static void |
nonVoidReturn(int line,
int column,
String text)
Prints an error message concerning a return value for a procedure. |
static void |
operandType(int line,
int column,
String lr,
ASTNode.Opcode op)
Prints an error message concerning an invalid operand type. |
static void |
parseError(int line,
int column,
String text)
Prints an error message concerning a syntax error. |
static void |
setFile(String fname)
Indicates the name of the input file. |
static void |
subscriptedScalar(int line,
int column,
String text)
Prints an error message concerning parentheses following an identifier that does not represent a function, procedure, or array. |
static void |
undeclaredIdentifier(int line,
int column,
String text)
Prints an error message concerning an undeclared identifier. |
static void |
unterminatedString(int line,
int column,
String text)
Prints an error message concerning a non-terminated string literal. |
static void |
wrongNumberArgs(int line,
int column,
String text)
Prints an error message concerning a call with the wrong number of args. |
static void |
wrongNumberSubscripts(int line,
int column,
String text)
Prints an error message concerning an array reference that does not have a single subscript. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int errors()
public static void setFile(String fname)
fname
- the name of the input filepublic static void invalidCharacter(int line, int column, String text)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.text
- a one-character String containing the invalid character.public static void unterminatedString(int line, int column, String text)
line
- the line number where the error occurred.column
- the position on the line of the first character of the
string literal appeared.text
- the entire non-terminated string.public static void badIntLiteral(int line, int column, String text)
line
- the line number where the error occurred.column
- the position on the line of the first character of the
integer literal appeared.text
- the entire invalid integer literal.public static void parseError(int line, int column, String text)
line
- the line number where the error occurred.column
- the position on the line of the first character of the
integer literal appeared.text
- the error message from the parser.public static void duplicateDeclaration(int line, int column, String text)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.text
- the identifier being declared.public static void undeclaredIdentifier(int line, int column, String text)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.text
- the undeclared identifier.public static void subscriptedScalar(int line, int column, String text)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.text
- the name being used as a function name.public static void wrongNumberArgs(int line, int column, String text)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.text
- the function being called.public static void wrongNumberSubscripts(int line, int column, String text)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.text
- the function being called.public static void badArgType(int line, int column, String text)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.text
- the name of the mismatched format parameter.public static void nonIntegerSubscript(int line, int column, String text)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.text
- the identifier being subscripted.public static void missingReturn(int line, int column, String text)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.text
- the name of the function.public static void nonVoidReturn(int line, int column, String text)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.text
- the name of the function.public static void badReturnType(int line, int column, String text)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.text
- the name of the function.public static void operandType(int line, int column, String lr, ASTNode.Opcode op)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.lr
- "left" or "right"op
- the operatorpublic static void nonBooleanExpression(int line, int column)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.public static void nonProcedureCall(int line, int column, String text)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.text
- the name of the supposed procedure.public static void invalidAssignment(int line, int column)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.public static void invalidRead(int line, int column)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.public static void invalidBound(int line, int column, String text)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.text
- either "lower" or "upper".public static void nonIntegerBound(int line, int column, String text)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.text
- either "lower" or "upper".public static void nonIntegerVariable(int line, int column)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.public static void nonLValueLHS(int line, int column)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.public static void nonLValueArg(int line, int column, ProcDeclNode.Mode mode, String text)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.mode
- either OUT or INOUT.text
- the name of the formal parameter.public static void functionOutParam(int line, int column, String text)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.text
- the name of the function.public static void complexExpression(int line, int column)
line
- the line number where the error occurred.column
- the position on the line where the error occurred.
|
CS 536 Fall 2007, Project 5 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |