示例#1
0
 internal static void ThrowDuplicatedLabel(TokenPosition position, string label)
 {
     Contract.Requires(!string.IsNullOrEmpty(label));
     throw new DuplicatedLabelException(
               FormatError(position.LineNo, position.ColumnNo, string.Format("Duplicated label \"{0}\"", label)));
 }
示例#2
0
 internal static void ThrowExpectedObject(TokenPosition position)
 {
     throw new ExpectedObjectException(FormatError(position.LineNo, position.ColumnNo, "Expected object"));
 }
示例#3
0
 internal static void ThrowExpectedFunction(TokenPosition position)
 {
     throw new ExpectedConstructorException(FormatError(position.LineNo, position.ColumnNo, "Expected function"));
 }
示例#4
0
 internal static void ThrowInvalidOperandType(TokenPosition position)
 {
     throw new InvalidOperandTypeException(FormatError(position.LineNo, position.ColumnNo, "Invalid operand type"));
 }
示例#5
0
 internal static void ThrowExpectedReference(TokenPosition position)
 {
     throw new ExpectedReferenceException(FormatError(position.LineNo, position.ColumnNo, "Expected reference"));
 }
示例#6
0
 internal static void ThrowExpectedCaseClause(TokenPosition position)
 {
     throw new ExpectedCaseClauseException(FormatError(position.LineNo, "Expected case clause"));
 }
示例#7
0
 internal static string FormatError(TokenPosition position, string message)
 {
     return(FormatError(position.LineNo, position.ColumnNo, message));
 }
示例#8
0
 internal static void ThrowUnsupportedCaseClauseExpression(TokenPosition position)
 {
     throw new UnsupportedCaseClauseExpressionException(
               FormatError(position.LineNo, position.ColumnNo, "Unsupported case clause expression"));
 }
示例#9
0
 internal static void ThrowExpectedCatchOrFinally(TokenPosition position)
 {
     throw new ExpectedCatchOrFinallyException(
               FormatError(position.LineNo, position.ColumnNo, "Expected catch or finally block"));
 }
示例#10
0
 internal static void ThrowUnexpectedLineTerminator(TokenPosition position)
 {
     throw new UnexpectedLineTerminatorException(
               FormatError(position.LineNo, position.ColumnNo, "Unexpected line terminator"));
 }
示例#11
0
 internal static void ThrowInvalidStatement(TokenPosition position)
 {
     throw new InvalidStatementException(FormatError(position.LineNo, position.ColumnNo, "Invalid statement"));
 }
示例#12
0
 internal static void ThrowParameterAlreadyDeclared(TokenPosition position, string parameterName)
 {
     Contract.Requires(!string.IsNullOrEmpty(parameterName));
     throw new ParameterAlreadyDeclaredException(
               FormatError(position.LineNo, position.ColumnNo, FormatParameterAlreadyDeclared(parameterName)));
 }