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))); }
internal static void ThrowExpectedObject(TokenPosition position) { throw new ExpectedObjectException(FormatError(position.LineNo, position.ColumnNo, "Expected object")); }
internal static void ThrowExpectedFunction(TokenPosition position) { throw new ExpectedConstructorException(FormatError(position.LineNo, position.ColumnNo, "Expected function")); }
internal static void ThrowInvalidOperandType(TokenPosition position) { throw new InvalidOperandTypeException(FormatError(position.LineNo, position.ColumnNo, "Invalid operand type")); }
internal static void ThrowExpectedReference(TokenPosition position) { throw new ExpectedReferenceException(FormatError(position.LineNo, position.ColumnNo, "Expected reference")); }
internal static void ThrowExpectedCaseClause(TokenPosition position) { throw new ExpectedCaseClauseException(FormatError(position.LineNo, "Expected case clause")); }
internal static string FormatError(TokenPosition position, string message) { return(FormatError(position.LineNo, position.ColumnNo, message)); }
internal static void ThrowUnsupportedCaseClauseExpression(TokenPosition position) { throw new UnsupportedCaseClauseExpressionException( FormatError(position.LineNo, position.ColumnNo, "Unsupported case clause expression")); }
internal static void ThrowExpectedCatchOrFinally(TokenPosition position) { throw new ExpectedCatchOrFinallyException( FormatError(position.LineNo, position.ColumnNo, "Expected catch or finally block")); }
internal static void ThrowUnexpectedLineTerminator(TokenPosition position) { throw new UnexpectedLineTerminatorException( FormatError(position.LineNo, position.ColumnNo, "Unexpected line terminator")); }
internal static void ThrowInvalidStatement(TokenPosition position) { throw new InvalidStatementException(FormatError(position.LineNo, position.ColumnNo, "Invalid statement")); }
internal static void ThrowParameterAlreadyDeclared(TokenPosition position, string parameterName) { Contract.Requires(!string.IsNullOrEmpty(parameterName)); throw new ParameterAlreadyDeclaredException( FormatError(position.LineNo, position.ColumnNo, FormatParameterAlreadyDeclared(parameterName))); }