1 /* This file is part of Shapes.
3 * Shapes is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
8 * Shapes is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with Shapes. If not, see <http://www.gnu.org/licenses/>.
16 * Copyright 2008, 2009, 2013, 2014, 2015 Henrik Tidefelt
21 #include "Shapes_Ast_decls.h"
22 #include "Shapes_Lang_decls.h"
23 #include "Shapes_Kernel_decls.h"
24 #include "Shapes_Exceptions_decls.h"
26 #include "sourcelocation.h"
27 #include "corelocation.h"
28 #include "identifier.h"
29 #include "exitcodes.h"
31 #include "simplepdfo.h"
32 #include "strrefdup.h" /* this is not needed in this file, but it is convenient to get these declarations for users of this file. */
33 #include "pdfversion.h"
52 RefCountPtr
< const char > msgMem_
;
55 MessageString( const char * msg
);
56 MessageString( const RefCountPtr
< const char > & msg
);
58 bool null( ) const { return msg_
== NULL
; }
59 void show( std::ostream
& os
) const;
60 void show( const std::string
& eachLinePrefix
, std::ostream
& os
) const;
63 std::ostream
& operator << ( std::ostream
& os
, const MessageString
& self
);
69 extern const std::string additionalLinesPrefix
;
75 virtual ~Exception( );
76 virtual void display( std::ostream
& os
) const = 0;
77 virtual Interaction::ExitCode
exitCode( ) const = 0;
78 static const char * locsep
;
81 class NotImplemented
: public Exception
83 const char * functionality_
;
85 NotImplemented( const char * functionality
);
86 virtual ~NotImplemented( );
87 virtual void display( std::ostream
& os
) const;
88 virtual Interaction::ExitCode
exitCode( ) const { return Interaction::EXIT_NOT_IMPLEMENTED
; }
91 class StaticInconsistency
: public Exception
94 const Ast::SourceLocation
& primaryLoc_
;
96 StaticInconsistency( const Ast::SourceLocation
& primaryLoc
) : primaryLoc_( primaryLoc
) { }
97 virtual ~StaticInconsistency( ) { }
98 const Ast::SourceLocation
& loc( ) const { return primaryLoc_
; }
99 virtual Interaction::ExitCode
exitCode( ) const { return Interaction::EXIT_USER_ERROR
; }
102 class PostCondition
: public Exception
105 const Ast::SourceLocation
& primaryLoc_
;
107 PostCondition( const Ast::SourceLocation
& primaryLoc
) : primaryLoc_( primaryLoc
) { }
108 virtual ~PostCondition( ) { }
109 const Ast::SourceLocation
& loc( ) const { return primaryLoc_
; }
110 virtual Interaction::ExitCode
exitCode( ) const { return Interaction::EXIT_USER_ERROR
; }
113 class MiscellaneousStaticInconsistency
: public StaticInconsistency
115 Interaction::MessageString msg_
;
117 MiscellaneousStaticInconsistency( const Ast::SourceLocation
& loc
, const Interaction::MessageString
& msg
);
118 virtual ~MiscellaneousStaticInconsistency( );
119 virtual void display( std::ostream
& os
) const;
122 class NamespaceDirectoryError
: public StaticInconsistency
124 Interaction::MessageString msg_
;
126 NamespaceDirectoryError( const Ast::SourceLocation
& loc
, const Interaction::MessageString
& msg
);
127 virtual ~NamespaceDirectoryError( );
128 virtual void display( std::ostream
& os
) const;
131 class AmbiguousNamespaceDirectory
: public StaticInconsistency
133 std::string previousName_
;
134 std::string currentDir_
;
136 AmbiguousNamespaceDirectory( const std::string
& previousName
, const std::string
& currentDir
);
137 virtual ~AmbiguousNamespaceDirectory( );
138 virtual void display( std::ostream
& os
) const;
141 class NamespaceDirectoryLookupError
: public StaticInconsistency
144 enum Type
{ NOT_FOUND
, WRONG_TYPE
, GLOBAL
};
147 Ast::NamespacePath namespacePath_
;
149 NamespaceDirectoryLookupError( const Ast::SourceLocation
& loc
, Type type
, const Ast::NamespacePath::const_iterator
& nsBegin
, const Ast::NamespacePath::const_iterator
& nsEnd
);
150 NamespaceDirectoryLookupError( Type type
, const Ast::NamespacePath::const_iterator
& nsBegin
, const Ast::NamespacePath::const_iterator
& nsEnd
);
151 virtual ~NamespaceDirectoryLookupError( );
152 virtual void display( std::ostream
& os
) const;
155 class NamespaceDirectoryFileError
: public StaticInconsistency
158 enum Type
{ NOT_FOUND
, WRONG_TYPE
};
161 Ast::NamespacePath namespacePath_
;
162 std::string filename_
;
164 NamespaceDirectoryFileError( const Ast::SourceLocation
& loc
, Type type
, const Ast::NamespacePath
& namespacePath
, const std::string
& filename
);
165 NamespaceDirectoryFileError( Type type
, const Ast::NamespacePath
& namespacePath
, const std::string
& filename
);
166 virtual ~NamespaceDirectoryFileError( );
167 virtual void display( std::ostream
& os
) const;
170 class NamespaceDirectoryInvalidEntries
: public StaticInconsistency
172 RefCountPtr
< const Ast::NamespacePath
> namespacePath_
;
173 std::set
< std::string
> invalidEntries_
;
175 NamespaceDirectoryInvalidEntries( const RefCountPtr
< const Ast::NamespacePath
> & namespacePath
, const std::set
< std::string
> & invalidEntries
);
176 virtual ~NamespaceDirectoryInvalidEntries( );
177 virtual void display( std::ostream
& os
) const;
180 class NamespaceDirectoryCircularOrdering
: public StaticInconsistency
182 RefCountPtr
< const Ast::NamespacePath
> namespacePath_
;
183 std::string cycleEntry_
;
185 NamespaceDirectoryCircularOrdering( const RefCountPtr
< const Ast::NamespacePath
> & namespacePath
, const std::string
& cycleEntry
);
186 virtual ~NamespaceDirectoryCircularOrdering( );
187 virtual void display( std::ostream
& os
) const;
190 class ScannerError
: public StaticInconsistency
192 Interaction::MessageString msg_
;
194 ScannerError( const Ast::SourceLocation
& loc
, const Interaction::MessageString
& msg
);
195 virtual ~ScannerError( );
196 virtual void display( std::ostream
& os
) const;
199 class ParserError
: public StaticInconsistency
201 Interaction::MessageString msg_
;
204 ParserError( const Ast::SourceLocation
& loc
, const Interaction::MessageString
& msg
, bool justAWarning
= false );
205 virtual ~ParserError( );
206 virtual void display( std::ostream
& os
) const;
209 class MemberAlsoAbstract
: public StaticInconsistency
212 const Ast::SourceLocation
& abstractLoc_
;
214 MemberAlsoAbstract( const Ast::SourceLocation
& memberLoc
, const char * id
, const Ast::SourceLocation
& abstractLoc
);
215 virtual ~MemberAlsoAbstract( );
216 virtual void display( std::ostream
& os
) const;
219 class MemberAlreadyDeclared
: public StaticInconsistency
222 const Ast::SourceLocation
& oldLoc_
;
224 MemberAlreadyDeclared( const Ast::SourceLocation
& memberLoc
, const char * id
, const Ast::SourceLocation
& oldLoc
);
225 virtual ~MemberAlreadyDeclared( );
226 virtual void display( std::ostream
& os
) const;
229 class PublicGetSetInNonfinalClass
: public StaticInconsistency
233 PublicGetSetInNonfinalClass( const Ast::SourceLocation
& memberLoc
, const char * id
);
234 virtual ~PublicGetSetInNonfinalClass( );
235 virtual void display( std::ostream
& os
) const;
238 class TransformingMemberInNonfinalClass
: public StaticInconsistency
242 TransformingMemberInNonfinalClass( const Ast::SourceLocation
& memberLoc
, const char * id
);
243 virtual ~TransformingMemberInNonfinalClass( );
244 virtual void display( std::ostream
& os
) const;
247 class RepeatedFormal
: public StaticInconsistency
251 RepeatedFormal( const Ast::SourceLocation
& loc
, const char * id
);
252 virtual ~RepeatedFormal( );
253 virtual void display( std::ostream
& os
) const;
256 class StateUninitializedUse
: public StaticInconsistency
258 const Ast::PlacedIdentifier
* id_
;
259 const Ast::Node
* decl_
;
261 StateUninitializedUse( const Ast::SourceLocation
& loc
, const Ast::PlacedIdentifier
* id
, const Ast::Node
* decl
);
262 virtual ~StateUninitializedUse( );
263 virtual void display( std::ostream
& os
) const;
266 class IllegalFreeStates
: public StaticInconsistency
268 Ast::StateIDSet
* freeStates_
;
269 const char * reason_
;
271 IllegalFreeStates( const Ast::SourceLocation
& loc
, Ast::StateIDSet
* freeStates
, const char * reason
);
272 virtual ~IllegalFreeStates( );
273 virtual void display( std::ostream
& os
) const;
276 class FreeStateIsAlsoPassed
: public StaticInconsistency
278 Ast::StateID stateID_
;
280 FreeStateIsAlsoPassed( const Ast::SourceLocation
& loc
, Ast::StateID stateID
);
281 virtual ~FreeStateIsAlsoPassed( );
282 virtual void display( std::ostream
& os
) const;
285 class RepeatedStateArgument
: public StaticInconsistency
287 RefCountPtr
< Ast::StateIDSet
> passedStates_
;
289 RepeatedStateArgument( const Ast::SourceLocation
& loc
, const RefCountPtr
< Ast::StateIDSet
> & passedStates
);
290 virtual ~RepeatedStateArgument( );
291 virtual void display( std::ostream
& os
) const;
294 class PassingStateOut
: public StaticInconsistency
298 PassingStateOut( const Ast::SourceLocation
& loc
, const char * id
);
299 virtual ~PassingStateOut( );
300 virtual void display( std::ostream
& os
) const;
303 class IntroducingExisting
: public StaticInconsistency
305 Ast::PlacedIdentifier id_
;
307 IntroducingExisting( const Ast::SourceLocation
& loc
, const Ast::PlacedIdentifier
& id
);
308 virtual ~IntroducingExisting( );
309 virtual void display( std::ostream
& os
) const;
312 class NamespaceAliasCollision
: public StaticInconsistency
314 const Ast::IdentifierTree
* tree_
;
317 NamespaceAliasCollision( const Ast::SourceLocation
& loc
, const Ast::IdentifierTree
* tree
, const char * name
);
318 virtual ~NamespaceAliasCollision( );
319 virtual void display( std::ostream
& os
) const;
322 class EncapsulationIntroducingExisting
: public StaticInconsistency
326 EncapsulationIntroducingExisting( const Ast::SourceLocation
& loc
, const char * id
);
327 virtual ~EncapsulationIntroducingExisting( );
328 virtual void display( std::ostream
& os
) const;
331 class EncapsulationNamespaceAliasCollision
: public StaticInconsistency
335 EncapsulationNamespaceAliasCollision( const Ast::SourceLocation
& loc
, const char * id
);
336 virtual ~EncapsulationNamespaceAliasCollision( );
337 virtual void display( std::ostream
& os
) const;
340 class FreezingUndefined
: public StaticInconsistency
342 Ast::PlacedIdentifier id_
;
344 FreezingUndefined( const Ast::SourceLocation
& loc
, const Ast::PlacedIdentifier
& id
);
345 virtual ~FreezingUndefined( );
346 virtual void display( std::ostream
& os
) const;
349 class UndefinedNamespace
: public StaticInconsistency
351 Ast::NamespaceReference id_
;
353 UndefinedNamespace( const Ast::SourceLocation
& loc
, const Ast::NamespaceReference
& id
);
354 virtual ~UndefinedNamespace( );
355 virtual void display( std::ostream
& os
) const;
358 class ExpectedImmediate
: public StaticInconsistency
361 ExpectedImmediate( const Ast::SourceLocation
& loc
);
362 virtual ~ExpectedImmediate( );
363 virtual void display( std::ostream
& os
) const;
366 class IllegalImperative
: public StaticInconsistency
369 IllegalImperative( const Ast::SourceLocation
& loc
);
370 virtual ~IllegalImperative( );
371 virtual void display( std::ostream
& os
) const;
374 class FileReadOpenError
: public Exception
377 enum Type
{ OPEN
, STAT
};
379 const Ast::SourceLocation
& loc_
;
380 RefCountPtr
< const char > filename_
;
382 const std::string
* sourceDir_
;
383 const std::list
< std::string
> * searchPath_
;
385 FileReadOpenError( const Ast::SourceLocation
& loc
, RefCountPtr
< const char > filename
, const std::string
* sourceDir
, const std::list
< std::string
> * searchPath
, Type type
= OPEN
);
386 virtual ~FileReadOpenError( );
387 virtual void display( std::ostream
& os
) const;
388 virtual Interaction::ExitCode
exitCode( ) const { return Interaction::EXIT_INPUT_FILE_ERROR
; }
391 class FileWriteOpenError
: public Exception
394 const Ast::SourceLocation
& loc_
;
395 RefCountPtr
< const char > filename_
;
396 const char * purpose_
;
398 FileWriteOpenError( const Ast::SourceLocation
& loc
, RefCountPtr
< const char > filename
, const char * purpose
= 0 );
399 virtual ~FileWriteOpenError( );
400 virtual void display( std::ostream
& os
) const;
401 virtual Interaction::ExitCode
exitCode( ) const { return Interaction::EXIT_OUTPUT_FILE_ERROR
; }
404 class TeXSetupTooLate
: public Exception
406 const Ast::SourceLocation
& loc_
;
408 TeXSetupTooLate( const Ast::SourceLocation
& loc
);
409 virtual ~TeXSetupTooLate( );
410 virtual void display( std::ostream
& os
) const;
411 virtual Interaction::ExitCode
exitCode( ) const { return Interaction::EXIT_USER_ERROR
; }
414 class EmptyFinalPicture
: public Exception
417 EmptyFinalPicture( );
418 virtual ~EmptyFinalPicture( );
419 virtual void display( std::ostream
& os
) const;
420 virtual Interaction::ExitCode
exitCode( ) const { return Interaction::EXIT_USER_ERROR
; }
423 class RuntimeError
: public Exception
426 const Ast::SourceLocation
& loc_
;
428 RuntimeError( const Ast::SourceLocation
& loc
);
429 RuntimeError( Ast::Expression
* expr
);
430 const Ast::SourceLocation
& getLoc( ) const;
431 virtual ~RuntimeError( );
432 virtual Interaction::ExitCode
exitCode( ) const { return Interaction::EXIT_USER_ERROR
; } /* This should be overridden when apropriate! */
435 class CatchableError
: public RuntimeError
438 CatchableError( const Ast::SourceLocation
& loc
);
439 CatchableError( Ast::Expression
* expr
);
440 virtual ~CatchableError( );
441 virtual RefCountPtr
< const Lang::Exception
> clone( const Kernel::ContRef
& cont
) const = 0;
444 class UncaughtError
: public RuntimeError
446 RefCountPtr
< const Lang::Exception
> ball_
;
448 UncaughtError( const RefCountPtr
< const Lang::Exception
> & ball
);
449 virtual ~UncaughtError( );
450 virtual void display( std::ostream
& os
) const;
451 virtual Interaction::ExitCode
exitCode( ) const;
452 const RefCountPtr
< const Lang::Exception
> & ball( ) const { return ball_
; }
455 class UserError
: public CatchableError
457 RefCountPtr
< const Lang::Symbol
> kind_
;
458 RefCountPtr
< const Lang::String
> source_
;
459 RefCountPtr
< const Lang::Value
> details_
;
460 Interaction::MessageString message_
;
462 UserError( const RefCountPtr
< const Lang::Symbol
> & kind
, const RefCountPtr
< const Lang::String
> & source
, const RefCountPtr
< const Lang::Value
> & details
, const Interaction::MessageString
& message
);
463 virtual ~UserError( );
464 virtual void display( std::ostream
& os
) const;
465 virtual RefCountPtr
< const Lang::Exception
> clone( const Kernel::ContRef
& cont
) const;
466 virtual Interaction::ExitCode
exitCode( ) const { return Interaction::EXIT_USER_DETECTED_ERROR
; }
469 class InternalError
: public RuntimeError
472 Interaction::MessageString msg_
;
475 InternalError( const Ast::SourceLocation
& loc
, const Interaction::MessageString
& msg
, bool justAWarning
= false );
476 InternalError( const Interaction::MessageString
& msg
, bool justAWarning
= false );
477 InternalError( const std::ostringstream
& msg
, bool justAWarning
= false );
478 virtual ~InternalError( );
479 virtual void display( std::ostream
& os
) const;
480 virtual Interaction::ExitCode
exitCode( ) const { return Interaction::EXIT_INTERNAL_ERROR
; }
483 class ExternalError
: public CatchableError
485 Interaction::MessageString msg_
;
488 ExternalError( const Interaction::MessageString
& msg
, bool justAWarning
= false );
489 virtual ~ExternalError( );
490 virtual void display( std::ostream
& os
) const;
491 virtual RefCountPtr
< const Lang::Exception
> clone( const Kernel::ContRef
& cont
) const;
492 virtual Interaction::ExitCode
exitCode( ) const { return Interaction::EXIT_EXTERNAL_ERROR
; }
493 ExternalError
* cloneTyped( ) const;
496 class InternalErrorIn
: public InternalError
498 Ast::PlacedIdentifier id_
;
500 InternalErrorIn( const Ast::PlacedIdentifier
& id
, const Interaction::MessageString
& msg
, bool justAWarning
= false );
501 virtual ~InternalErrorIn( );
502 virtual void display( std::ostream
& os
) const;
503 virtual Interaction::ExitCode
exitCode( ) const { return Interaction::EXIT_INTERNAL_ERROR
; }
506 class TeXSetupHasChanged
: public InternalError
509 TeXSetupHasChanged( );
510 virtual ~TeXSetupHasChanged( );
513 class MiscellaneousRequirement
: public CatchableError
515 Interaction::MessageString msg_
;
517 MiscellaneousRequirement( const Ast::SourceLocation
& loc
, const Interaction::MessageString
& msg
);
518 MiscellaneousRequirement( const Interaction::MessageString
& msg
);
519 virtual ~MiscellaneousRequirement( );
520 virtual void display( std::ostream
& os
) const;
521 virtual RefCountPtr
< const Lang::Exception
> clone( const Kernel::ContRef
& cont
) const;
524 class HandlerError
: public CatchableError
526 Interaction::MessageString msg_
;
528 HandlerError( const Interaction::MessageString
& msg
);
529 virtual ~HandlerError( );
530 virtual void display( std::ostream
& os
) const;
531 virtual RefCountPtr
< const Lang::Exception
> clone( const Kernel::ContRef
& cont
) const;
534 class PDFVersionError
: public CatchableError
536 SimplePDF::PDF_Version::Version version_
;
537 SimplePDF::PDF_Version::Version required_
;
538 Interaction::MessageString msg_
;
541 PDFVersionError( SimplePDF::PDF_Version::Version version
, SimplePDF::PDF_Version::Version required
, const Interaction::MessageString
& msg
, bool justAWarning
= false );
542 virtual ~PDFVersionError( );
543 virtual void display( std::ostream
& os
) const;
544 virtual RefCountPtr
< const Lang::Exception
> clone( const Kernel::ContRef
& cont
) const;
547 class RedefiningLexical
: public RuntimeError
549 Ast::PlacedIdentifier id_
;
551 RedefiningLexical( const Ast::PlacedIdentifier
& id
);
552 virtual ~RedefiningLexical( );
553 virtual void display( std::ostream
& os
) const;
556 class RedefiningDynamic
: public RuntimeError
558 Ast::PlacedIdentifier id_
;
560 RedefiningDynamic( const Ast::PlacedIdentifier
& id
);
561 virtual ~RedefiningDynamic( );
562 virtual void display( std::ostream
& os
) const;
565 class TypeMismatch
: public RuntimeError
568 RefCountPtr
< const char > valueType_
;
569 RefCountPtr
< const char > expectedType_
;
571 TypeMismatch( const Ast::SourceLocation
& loc
, const char * hint
, RefCountPtr
< const char > valueType
, RefCountPtr
< const char > expectedType
);
572 TypeMismatch( const Ast::SourceLocation
& loc
, RefCountPtr
< const char > valueType
, RefCountPtr
< const char > expectedType
);
573 virtual ~TypeMismatch( );
574 virtual void display( std::ostream
& os
) const;
577 class ExpectedList
: public RuntimeError
580 RefCountPtr
< const char > nonListType_
;
582 ExpectedList( const Ast::SourceLocation
& loc
, size_t index
, RefCountPtr
< const char > nonListType
);
583 virtual ~ExpectedList( );
584 virtual void display( std::ostream
& os
) const;
587 class NonObjectMemberAssignment
: public RuntimeError
589 RefCountPtr
< const char > valueType_
;
591 NonObjectMemberAssignment( const Ast::SourceLocation
& loc
, RefCountPtr
< const char > valueType
);
592 virtual ~NonObjectMemberAssignment( );
593 virtual void display( std::ostream
& os
) const;
596 class ElementaryWithout
: public RuntimeError
599 enum Kind
{ VALUE
, STATE
};
600 enum Ref
{ FIELD
, MUTATOR
};
604 RefCountPtr
< const char > valueType_
;
606 ElementaryWithout( Kind kind
, Ref ref
, RefCountPtr
< const char > valueType
);
607 virtual ~ElementaryWithout( );
608 virtual void display( std::ostream
& os
) const;
611 class NonExistentMember
: public RuntimeError
613 RefCountPtr
< const char > valueType_
;
614 const char * fieldID_
;
616 NonExistentMember( RefCountPtr
< const char > valueType
, const char * fieldID
);
617 virtual ~NonExistentMember( );
618 virtual void display( std::ostream
& os
) const;
621 class NonExistentMutator
: public RuntimeError
623 RefCountPtr
< const char > valueType_
;
624 const char * mutatorID_
;
626 NonExistentMutator( RefCountPtr
< const char > valueType
, const char * mutatorID
);
627 virtual ~NonExistentMutator( );
628 virtual void display( std::ostream
& os
) const;
631 class NonExistentPosition
: public RuntimeError
636 NonExistentPosition( size_t pos
, size_t maxPos
);
637 virtual ~NonExistentPosition( );
638 virtual void display( std::ostream
& os
) const;
641 class UnaryPrefixNotApplicable
: public RuntimeError
643 const Ast::Expression
* expr_
;
644 RefCountPtr
< const char > valueType_
;
645 RefCountPtr
< const Interaction::CoreLocation
> coreLoc_
;
647 UnaryPrefixNotApplicable( const Ast::SourceLocation
& loc
, const Ast::Expression
* expr
, RefCountPtr
< const char > valueType
);
648 virtual ~UnaryPrefixNotApplicable( );
649 void setCoreLocation( const RefCountPtr
< const Interaction::CoreLocation
> & coreLoc
);
650 virtual void display( std::ostream
& os
) const;
653 class UnaryPostfixNotApplicable
: public RuntimeError
655 const Ast::Expression
* expr_
;
656 RefCountPtr
< const char > valueType_
;
657 RefCountPtr
< const Interaction::CoreLocation
> coreLoc_
;
659 UnaryPostfixNotApplicable( const Ast::SourceLocation
& loc
, const Ast::Expression
* expr
, RefCountPtr
< const char > valueType
);
660 virtual ~UnaryPostfixNotApplicable( );
661 void setCoreLocation( const RefCountPtr
< const Interaction::CoreLocation
> & coreLoc
);
662 virtual void display( std::ostream
& os
) const;
665 class BinaryInfixNotApplicable
: public RuntimeError
667 const Ast::Expression
* expr1_
;
668 RefCountPtr
< const char > valueType1_
;
669 const Ast::Expression
* expr2_
;
670 RefCountPtr
< const char > valueType2_
;
671 RefCountPtr
< const Interaction::CoreLocation
> coreLoc_
;
673 BinaryInfixNotApplicable( const Ast::SourceLocation
& loc
, const Ast::Expression
* expr1
, RefCountPtr
< const char > valueType1
, const Ast::Expression
* expr2
, RefCountPtr
< const char > valueType2
);
674 virtual ~BinaryInfixNotApplicable( );
675 void setCoreLocation( const RefCountPtr
< const Interaction::CoreLocation
> & coreLoc
);
676 virtual void display( std::ostream
& os
) const;
679 class LookupUnknown
: public StaticInconsistency
682 Ast::Identifier::Type type_
;
684 LookupUnknown( const Ast::SourceLocation
& loc
, const Ast::Identifier
& id
, Ast::Identifier::Type type
);
685 virtual ~LookupUnknown( );
686 virtual void display( std::ostream
& os
) const;
689 class LookupUnknownPrivateAlias
: public StaticInconsistency
691 Ast::PlacedIdentifier id_
;
692 Ast::Identifier::Type type_
;
694 LookupUnknownPrivateAlias( const Ast::SourceLocation
& loc
, const Ast::PlacedIdentifier
& id
, Ast::Identifier::Type type
);
695 virtual ~LookupUnknownPrivateAlias( );
696 virtual void display( std::ostream
& os
) const;
699 class StateBeyondFunctionBoundary
: public StaticInconsistency
703 StateBeyondFunctionBoundary( const Ast::SourceLocation
& loc
, const Ast::Identifier
& id
);
704 virtual ~StateBeyondFunctionBoundary( );
705 virtual void display( std::ostream
& os
) const;
708 class IntroducingExistingUnit
: public StaticInconsistency
710 RefCountPtr
< const char > id_
;
712 IntroducingExistingUnit( const Ast::SourceLocation
& loc
, RefCountPtr
< const char > id
);
713 virtual ~IntroducingExistingUnit( );
714 virtual void display( std::ostream
& os
) const;
717 class LookupUnknownUnit
: public StaticInconsistency
719 RefCountPtr
< const char > id_
;
721 LookupUnknownUnit( const Ast::SourceLocation
& loc
, RefCountPtr
< const char > id
);
722 virtual ~LookupUnknownUnit( );
723 virtual void display( std::ostream
& os
) const;
726 class OutOfRange
: public CatchableError
728 Interaction::MessageString msg_
;
730 OutOfRange( const Interaction::MessageString
& msg
);
731 OutOfRange( const Ast::SourceLocation
& loc
, const Interaction::MessageString
& msg
);
732 virtual ~OutOfRange( );
733 virtual void display( std::ostream
& os
) const;
734 virtual RefCountPtr
< const Lang::Exception
> clone( const Kernel::ContRef
& cont
) const;
737 class FontProblem
: public CatchableError
739 RefCountPtr
< const Lang::Symbol
> PostScript_name_
;
740 Interaction::MessageString msg_
;
743 FontProblem( const RefCountPtr
< const Lang::Symbol
> & PostScript_name
, const Interaction::MessageString
& msg
, bool justAWarning
= false );
744 FontProblem( const RefCountPtr
< const Lang::Symbol
> & PostScript_name
, const Ast::SourceLocation
& loc
, const Interaction::MessageString
& msg
, bool justAWarning
= false );
745 virtual ~FontProblem( );
746 virtual void display( std::ostream
& os
) const;
747 virtual RefCountPtr
< const Lang::Exception
> clone( const Kernel::ContRef
& cont
) const;
750 class NonVoidStatement
: public RuntimeError
752 RefCountPtr
< const Lang::Value
> val_
;
754 NonVoidStatement( const Ast::SourceLocation
& loc
, RefCountPtr
< const Lang::Value
> val
);
755 virtual ~NonVoidStatement( );
756 virtual void display( std::ostream
& os
) const;
759 class UserArityMismatch
: public RuntimeError
762 enum Type
{ VARIABLE
, STATE
};
764 const Ast::SourceLocation
& formalsLoc_
;
765 const size_t functionArity_
;
766 const size_t callArity_
;
769 UserArityMismatch( const Ast::SourceLocation
& callLoc
, const Ast::SourceLocation
& formalsLoc
, size_t functionArity
, size_t callArity
, const Type type
);
770 virtual ~UserArityMismatch( );
771 virtual void display( std::ostream
& os
) const;
774 class SinkRequired
: public RuntimeError
777 const Ast::SourceLocation
& formalsLoc_
;
778 const size_t formalsArity_
;
779 const size_t callArity_
;
781 SinkRequired( const Ast::SourceLocation
& formalsLoc
, size_t formalsArity
, size_t callArity
);
782 virtual ~SinkRequired( );
783 virtual void display( std::ostream
& os
) const;
786 class NamedFormalMismatch
: public RuntimeError
789 enum Type
{ VARIABLE
, STATE
};
791 const Ast::SourceLocation
& formalsLoc_
;
792 RefCountPtr
< const char > name_
;
795 NamedFormalMismatch( const Ast::SourceLocation
& formalsLoc
, RefCountPtr
< const char > name
, Type type
);
796 virtual ~NamedFormalMismatch( );
797 virtual void display( std::ostream
& os
) const;
800 class NamedFormalAlreadySpecified
: public RuntimeError
803 enum Type
{ VARIABLE
, STATE
};
805 const Ast::SourceLocation
& formalsLoc_
;
806 RefCountPtr
< const char > name_
;
810 NamedFormalAlreadySpecified( const Ast::SourceLocation
& formalsLoc
, RefCountPtr
< const char > name
, size_t pos
, Type type
);
811 virtual ~NamedFormalAlreadySpecified( );
812 virtual void display( std::ostream
& os
) const;
815 class MissingArguments
: public RuntimeError
817 const Ast::SourceLocation
& formalsLoc_
;
818 RefCountPtr
< const std::map
< size_t, RefCountPtr
< const char > > > missingVariables_
;
819 RefCountPtr
< const std::map
< size_t, RefCountPtr
< const char > > > missingStates_
;
821 MissingArguments( const Ast::SourceLocation
& callLoc
, const Ast::SourceLocation
& formalsLoc
, std::map
< size_t, RefCountPtr
< const char > > * missingVariables
, std::map
< size_t, RefCountPtr
< const char > > * missingStates
);
822 ~MissingArguments( );
823 virtual void display( std::ostream
& os
) const;
826 class CoreArityMismatch
: public RuntimeError
828 RefCountPtr
< const Interaction::CoreLocation
> coreLoc_
;
829 const size_t functionArityLow_
;
830 const size_t functionArityHigh_
;
831 const size_t callArity_
;
833 CoreArityMismatch( const RefCountPtr
< const Interaction::CoreLocation
> & coreLoc
, size_t functionArity
, size_t callArity
);
834 CoreArityMismatch( Interaction::CoreLocation
* coreLoc
, size_t functionArity
, size_t callArity
); /* Transfers ownership. */
835 CoreArityMismatch( const RefCountPtr
< const Interaction::CoreLocation
> & coreLoc
, size_t functionArityLow
, size_t functionArityHigh
, size_t callArity
);
836 /* Convenience constructors for the most common use cases. */
837 CoreArityMismatch( const Ast::PlacedIdentifier
& coreId
, size_t functionArity
, size_t callArity
);
838 CoreArityMismatch( const Ast::PlacedIdentifier
& coreId
, size_t functionArityLow
, size_t functionArityHigh
, size_t callArity
);
839 CoreArityMismatch( const char * coreSyntax
, size_t functionArity
, size_t callArity
);
840 virtual ~CoreArityMismatch( );
841 virtual void display( std::ostream
& os
) const;
844 class CoreNoNamedFormals
: public RuntimeError
848 CoreNoNamedFormals( const char * what
);
849 virtual ~CoreNoNamedFormals( );
850 virtual void display( std::ostream
& os
) const;
853 class CoreTypeMismatch
: public RuntimeError
855 RefCountPtr
< const Interaction::CoreLocation
> coreLoc_
;
856 const Ast::SourceLocation
& argLoc_
;
857 RefCountPtr
< const char > valueType_
;
858 RefCountPtr
< const char > expectedType_
;
860 CoreTypeMismatch( const Ast::SourceLocation
& callLoc
,
861 Interaction::CoreLocation
* coreLoc
, /* Transfers ownership. */
862 const Ast::SourceLocation
& argLoc
,
863 RefCountPtr
< const char > valueType
,
864 RefCountPtr
< const char > expectedType
);
865 CoreTypeMismatch( const Ast::SourceLocation
& callLoc
,
866 const RefCountPtr
< const Interaction::CoreLocation
> & coreLoc
,
867 Kernel::Arguments
& args
,
869 RefCountPtr
< const char > expectedType
);
870 CoreTypeMismatch( const Ast::SourceLocation
& callLoc
,
871 Interaction::CoreLocation
* coreLoc
, /* Transfers ownership. */
872 Kernel::Arguments
& args
,
874 RefCountPtr
< const char > expectedType
);
875 /* Convenience constructor for the most common use case. */
876 CoreTypeMismatch( const Ast::SourceLocation
& callLoc
,
877 const Ast::PlacedIdentifier
& coreId
,
878 Kernel::Arguments
& args
,
880 RefCountPtr
< const char > expectedType
);
881 virtual ~CoreTypeMismatch( );
882 virtual void display( std::ostream
& os
) const;
885 class CoreDynamicTypeMismatch
: public RuntimeError
887 RefCountPtr
< const Interaction::CoreLocation
> coreLoc_
;
888 Ast::PlacedIdentifier id_
;
889 RefCountPtr
< const char > valueType_
;
890 RefCountPtr
< const char > expectedType_
;
892 CoreDynamicTypeMismatch( const Ast::SourceLocation
& callLoc
,
893 const Ast::PlacedIdentifier
& coreId
,
894 const Ast::PlacedIdentifier
& id
,
895 RefCountPtr
< const char > valueType
,
896 RefCountPtr
< const char > expectedType
);
897 virtual ~CoreDynamicTypeMismatch( );
898 virtual void display( std::ostream
& os
) const;
901 class CoreStateTypeMismatch
: public RuntimeError
903 RefCountPtr
< const Interaction::CoreLocation
> coreLoc_
;
904 const Ast::SourceLocation
& argLoc_
;
905 RefCountPtr
< const char > valueType_
;
906 RefCountPtr
< const char > expectedType_
;
908 CoreStateTypeMismatch( const Ast::SourceLocation
& callLoc
,
909 const Ast::PlacedIdentifier
& coreId
,
910 const Ast::SourceLocation
& argLoc
,
911 RefCountPtr
< const char > valueType
,
912 RefCountPtr
< const char > expectedType
);
913 virtual ~CoreStateTypeMismatch( );
914 virtual void display( std::ostream
& os
) const;
917 class ContinuationTypeMismatch
: public RuntimeError
919 RefCountPtr
< const char > valueType_
;
920 RefCountPtr
< const char > expectedType_
;
922 ContinuationTypeMismatch( const Kernel::Continuation
* locationCont
,
923 RefCountPtr
< const char > valueType
,
924 RefCountPtr
< const char > expectedType
);
925 virtual ~ContinuationTypeMismatch( );
926 virtual void display( std::ostream
& os
) const;
929 class CoreOutOfRange
: public CatchableError
931 RefCountPtr
< const Interaction::CoreLocation
> coreLoc_
;
933 const Ast::SourceLocation
& argLoc_
;
934 Interaction::MessageString msg_
;
936 CoreOutOfRange( const Ast::SourceLocation
& callLoc
,
937 const Ast::PlacedIdentifier
& coreId
,
938 Kernel::Arguments
& args
,
940 const Interaction::MessageString
& msg
);
941 CoreOutOfRange( const Ast::PlacedIdentifier
& coreId
, Kernel::Arguments
& args
, size_t argNo
, const Interaction::MessageString
& msg
);
942 CoreOutOfRange( const Ast::SourceLocation
& callLoc
,
943 const RefCountPtr
< const Interaction::CoreLocation
> & coreLoc
,
944 Kernel::Arguments
& args
,
946 const Interaction::MessageString
& msg
);
947 CoreOutOfRange( const RefCountPtr
< const Interaction::CoreLocation
> & coreLoc
, Kernel::Arguments
& args
, size_t argNo
, const Interaction::MessageString
& msg
);
948 CoreOutOfRange( Interaction::CoreLocation
* coreLoc
, Kernel::Arguments
& args
, size_t argNo
, const Interaction::MessageString
& msg
); /* Transfers ownership. */
949 virtual ~CoreOutOfRange( );
950 virtual void display( std::ostream
& os
) const;
951 virtual RefCountPtr
< const Lang::Exception
> clone( const Kernel::ContRef
& cont
) const;
953 void setMessage( const Interaction::MessageString
& msg
);
956 class UserOutOfRange
: public CatchableError
958 RefCountPtr
< const Lang::Symbol
> kind_
;
959 RefCountPtr
< const Lang::String
> source_
;
960 RefCountPtr
< const Lang::Integer
> details_
;
961 Interaction::MessageString message_
;
963 UserOutOfRange( const RefCountPtr
< const Lang::Symbol
> & kind
, const RefCountPtr
< const Lang::String
> & source
, const RefCountPtr
< const Lang::Integer
> & details
, const Interaction::MessageString
& message
);
964 virtual ~UserOutOfRange( );
965 virtual void display( std::ostream
& os
) const;
966 virtual RefCountPtr
< const Lang::Exception
> clone( const Kernel::ContRef
& cont
) const;
969 class UserTypeMismatch
: public CatchableError
971 RefCountPtr
< const Lang::Symbol
> kind_
;
972 RefCountPtr
< const Lang::String
> source_
;
973 RefCountPtr
< const Lang::Integer
> details_
;
974 RefCountPtr
< const char > expectedType_
;
975 RefCountPtr
< const char > valueType_
;
977 UserTypeMismatch( const RefCountPtr
< const Lang::Symbol
> & kind
, const RefCountPtr
< const Lang::String
> & source
, const RefCountPtr
< const Lang::Integer
> & details
, const RefCountPtr
< const char > & expectedType
, const RefCountPtr
< const char > & valueType
);
978 virtual ~UserTypeMismatch( );
979 virtual void display( std::ostream
& os
) const;
980 virtual RefCountPtr
< const Lang::Exception
> clone( const Kernel::ContRef
& cont
) const;
983 class CoreRequirement
: public CatchableError
985 RefCountPtr
< const Interaction::CoreLocation
> coreLoc_
;
986 Interaction::MessageString msg_
;
988 CoreRequirement( const Interaction::MessageString
& msg
, const RefCountPtr
< const Interaction::CoreLocation
> & coreLoc
, const Ast::SourceLocation
& callLoc
);
989 CoreRequirement( const Interaction::MessageString
& msg
, Interaction::CoreLocation
* coreLoc
, const Ast::SourceLocation
& callLoc
); /* Transfers ownership. */
990 /* Convenience constructor for the most common use case. */
991 CoreRequirement( const Interaction::MessageString
& msg
, const Ast::PlacedIdentifier
& id
, const Ast::SourceLocation
& callLoc
);
992 virtual ~CoreRequirement( );
993 virtual void display( std::ostream
& os
) const;
994 virtual RefCountPtr
< const Lang::Exception
> clone( const Kernel::ContRef
& cont
) const;
997 class BuildRequirement
: public CatchableError
999 RefCountPtr
< const Interaction::CoreLocation
> coreLoc_
;
1000 const char * dependency_
;
1002 BuildRequirement( const char * dependency
, const RefCountPtr
< const Interaction::CoreLocation
> & coreLoc
, const Ast::SourceLocation
& callLoc
);
1003 /* Convenience constructor for the most common use case. */
1004 BuildRequirement( const char * dependency
, const Ast::PlacedIdentifier
& id
, const Ast::SourceLocation
& callLoc
);
1005 virtual ~BuildRequirement( );
1006 virtual void display( std::ostream
& os
) const;
1007 virtual RefCountPtr
< const Lang::Exception
> clone( const Kernel::ContRef
& cont
) const;
1010 class TeXLabelError
: public RuntimeError
1012 const Ast::SourceLocation
& strLoc_
;
1014 const char * region_
;
1015 Interaction::MessageString summary_
;
1016 Interaction::MessageString details_
;
1018 TeXLabelError( bool quoted
, const char * region
, const Interaction::MessageString
& summary
, const Interaction::MessageString
& details
, const Ast::SourceLocation
& strLoc
);
1019 virtual ~TeXLabelError( );
1020 virtual void display( std::ostream
& os
) const;
1021 virtual Interaction::ExitCode
exitCode( ) const { return Interaction::EXIT_TEX_ERROR
; }
1024 class StaticTeXLabelError
: public StaticInconsistency
1027 const char * region_
;
1028 Interaction::MessageString summary_
;
1029 Interaction::MessageString details_
;
1031 StaticTeXLabelError( bool quoted
, const char * region
, const Interaction::MessageString
& summary
, const Interaction::MessageString
& details
, const Ast::SourceLocation
& strLoc
);
1032 virtual ~StaticTeXLabelError( );
1033 virtual void display( std::ostream
& os
) const;
1034 virtual Interaction::ExitCode
exitCode( ) const { return Interaction::EXIT_TEX_ERROR
; }
1037 class MultipleDynamicBind
: public RuntimeError
1039 const Ast::PlacedIdentifier
* id_
;
1040 const Ast::SourceLocation
& prevLoc_
;
1042 MultipleDynamicBind( const Ast::PlacedIdentifier
* id
, const Ast::SourceLocation
& loc
, const Ast::SourceLocation
& prevLoc
);
1043 virtual ~MultipleDynamicBind( );
1044 virtual void display( std::ostream
& os
) const;
1047 class UndefinedEscapeContinuation
: public RuntimeError
1051 UndefinedEscapeContinuation( const char * id
, const Ast::SourceLocation
& loc
);
1052 virtual ~UndefinedEscapeContinuation( );
1053 virtual void display( std::ostream
& os
) const;
1056 class DeadStateAccess
: public RuntimeError
1060 virtual ~DeadStateAccess( );
1061 virtual void display( std::ostream
& os
) const;
1064 class UnFreezable
: public RuntimeError
1068 virtual ~UnFreezable( );
1069 virtual void display( std::ostream
& os
) const;
1072 class UnPeekable
: public RuntimeError
1076 virtual ~UnPeekable( );
1077 virtual void display( std::ostream
& os
) const;
1080 class UninitializedAccess
: public RuntimeError
1083 UninitializedAccess( );
1084 virtual ~UninitializedAccess( );
1085 virtual void display( std::ostream
& os
) const;
1088 class DtMinError
: public CatchableError
1092 DtMinError( double dt
);
1093 virtual ~DtMinError( );
1094 virtual void display( std::ostream
& os
) const;
1095 virtual RefCountPtr
< const Lang::Exception
> clone( const Kernel::ContRef
& cont
) const;
1096 virtual Interaction::ExitCode
exitCode( ) const { return Interaction::EXIT_TOLERANCE_ERROR
; }
1099 class AffineTransformKillsPlane
: public CatchableError
1103 AffineTransformKillsPlane( double sigma2
);
1104 virtual ~AffineTransformKillsPlane( );
1105 virtual void display( std::ostream
& os
) const;
1106 virtual RefCountPtr
< const Lang::Exception
> clone( const Kernel::ContRef
& cont
) const;
1109 class MissingFontMetrics
: public RuntimeError
1111 RefCountPtr
< const char > fontname_
;
1112 const std::list
< std::string
> * searchPath_
;
1114 MissingFontMetrics( RefCountPtr
< const char > fontname
, const std::list
< std::string
> * searchPath
);
1115 virtual ~MissingFontMetrics( );
1116 virtual void display( std::ostream
& os
) const;
1117 virtual Interaction::ExitCode
exitCode( ) const { return Interaction::EXIT_EXTERNAL_ERROR
; }
1120 class FontMetricsError
: public RuntimeError
1122 RefCountPtr
< const char > fontname_
;
1123 Interaction::MessageString message_
;
1125 FontMetricsError( const RefCountPtr
< const char > & fontname
, const Interaction::MessageString
& message
);
1126 virtual ~FontMetricsError( );
1127 virtual void display( std::ostream
& os
) const;
1128 virtual Interaction::ExitCode
exitCode( ) const { return Interaction::EXIT_EXTERNAL_ERROR
; }
1131 class InsertingEmptyPage
: public CatchableError
1134 InsertingEmptyPage( const Ast::SourceLocation
& loc
);
1135 virtual ~InsertingEmptyPage( );
1136 virtual void display( std::ostream
& os
) const;
1137 virtual RefCountPtr
< const Lang::Exception
> clone( const Kernel::ContRef
& cont
) const;
1140 class InvalidGraphKeyType
: public InternalError
1143 InvalidGraphKeyType( );
1144 virtual ~InvalidGraphKeyType( );
1147 class GraphKeyTypeMismatch
: public TypeMismatch
1150 GraphKeyTypeMismatch( const Ast::SourceLocation
& loc
, const char * hint
, RefCountPtr
< const char > valueType
);
1151 virtual ~GraphKeyTypeMismatch( );
1152 static RefCountPtr
< const char > expectedType
;
1153 static RefCountPtr
< const char > expectedTypeOrNode
;
1154 static RefCountPtr
< const char > expectedTypeOrStructure
;
1157 class InvalidGraphKey
: public InternalError
1160 enum Type
{ NODE
, PARTITION
};
1162 InvalidGraphKey( Type type
);
1163 virtual ~InvalidGraphKey( );
1166 class GraphKeyOutOfRange
: public CoreOutOfRange
1169 enum Type
{ NODE
, PARTITION
};
1173 GraphKeyOutOfRange( Type type
, const Ast::SourceLocation
& callLoc
, const Ast::PlacedIdentifier
& coreId
, Kernel::Arguments
& args
, size_t argNo
);
1174 GraphKeyOutOfRange( Type type
, const Ast::SourceLocation
& callLoc
, const RefCountPtr
< const Interaction::CoreLocation
> & coreLoc
, Kernel::Arguments
& args
, size_t argNo
);
1175 virtual ~GraphKeyOutOfRange( );
1177 void initMessage( Kernel::Arguments
& args
, size_t argNo
);
1180 class InvalidGraphElement
: public CatchableError
1183 enum Type
{ NODE
, EDGE
};
1187 InvalidGraphElement( Type type
, const Ast::SourceLocation
& loc
);
1188 virtual ~InvalidGraphElement( );
1189 virtual void display( std::ostream
& os
) const;
1190 virtual RefCountPtr
< const Lang::Exception
> clone( const Kernel::ContRef
& cont
) const;
1193 class EdgeTraceError
: public CatchableError
1196 enum Type
{ UNDIRECTED
, TRACE
, BACKTRACE
};
1199 RefCountPtr
< const Lang::Value
> edgeKeyFrom_
;
1200 RefCountPtr
< const Lang::Value
> edgeKeyTo_
;
1201 RefCountPtr
< const Lang::Value
> nodeKey_
;
1203 EdgeTraceError( Type type
, const RefCountPtr
< const Lang::Value
> & edgeKeyFrom
, const RefCountPtr
< const Lang::Value
> & edgeKeyTo
, const RefCountPtr
< const Lang::Value
> & nodeKey
, const Ast::SourceLocation
& loc
);
1204 virtual ~EdgeTraceError( );
1205 virtual void display( std::ostream
& os
) const;
1206 virtual RefCountPtr
< const Lang::Exception
> clone( const Kernel::ContRef
& cont
) const;
1209 class GraphDomainError
: public CatchableError
1212 enum Type
{ DIRECTED
, UNDIRECTED
, LOOPS
, PARALLEL
};
1216 RefCountPtr
< const Lang::Value
> edgeKeyFrom_
;
1217 RefCountPtr
< const Lang::Value
> edgeKeyTo_
;
1219 GraphDomainError( Type type
, bool directed
, const RefCountPtr
< const Lang::Value
> & edgeKeyFrom
, const RefCountPtr
< const Lang::Value
> & edgeKeyTo
, const Ast::SourceLocation
& loc
);
1220 virtual ~GraphDomainError( );
1221 virtual void display( std::ostream
& os
) const;
1222 virtual RefCountPtr
< const Lang::Exception
> clone( const Kernel::ContRef
& cont
) const;
1225 class InvalidGraphPartition
: public CatchableError
1227 RefCountPtr
< const Lang::Value
> partition_
;
1228 RefCountPtr
< const Lang::SingleList
> partitions_
;
1230 InvalidGraphPartition( const RefCountPtr
< const Lang::Value
> & partition
, const RefCountPtr
< const Lang::SingleList
> & partitions
, const Ast::SourceLocation
& loc
);
1231 virtual ~InvalidGraphPartition( );
1232 virtual void display( std::ostream
& os
) const;
1233 virtual RefCountPtr
< const Lang::Exception
> clone( const Kernel::ContRef
& cont
) const;
1236 class GraphPartitionViolation
: public CatchableError
1238 RefCountPtr
< const Lang::Value
> sourceKey_
;
1239 RefCountPtr
< const Lang::Value
> targetKey_
;
1240 RefCountPtr
< const Lang::Value
> partition_
;
1242 GraphPartitionViolation( const RefCountPtr
< const Lang::Value
> & sourceKey
, const RefCountPtr
< const Lang::Value
> & targetKey
, const RefCountPtr
< const Lang::Value
> & partition
, const Ast::SourceLocation
& loc
);
1243 virtual ~GraphPartitionViolation( );
1244 virtual void display( std::ostream
& os
) const;
1245 virtual RefCountPtr
< const Lang::Exception
> clone( const Kernel::ContRef
& cont
) const;
1249 class UndefinedCrossRef
: public PostCondition
1252 RefCountPtr
< const char > ref_
;
1254 UndefinedCrossRef( const Ast::SourceLocation
& loc
, RefCountPtr
< const char > ref
);
1255 virtual ~UndefinedCrossRef( );
1256 virtual void display( std::ostream
& os
) const;
1259 class InvocationError
: public Exception
1261 Interaction::MessageString msg_
;
1264 InvocationError( const Interaction::MessageString
& msg
, bool justAWarning
= false );
1265 virtual ~InvocationError( );
1266 virtual void display( std::ostream
& os
) const;
1267 virtual Interaction::ExitCode
exitCode( ) const { return Interaction::EXIT_INVOCATION_ERROR
; }
1270 class BadSetValueState
: public InternalError
1273 BadSetValueState( );
1274 virtual ~BadSetValueState( );
1279 namespace NonLocalExit
1281 /* The exceptions in this namespace does not represent ordinary exception conditions in the program.
1282 * Rather, they can be seen as alternative ways for particular functions to return. Thus, the caller
1283 * of such a function shall always take care of any such exceptions, and not let these be passed up.
1284 * For this reason, the classes in this namespace does not inherit from Shapes::Exceptions::Exception.
1287 class NonLocalExitBase
1290 NonLocalExitBase( ){ }
1293 class DynamicBindingNotFound
: public NonLocalExitBase
1296 DynamicBindingNotFound( ){ }
1299 class CrossDirectionOfParallel
: public NonLocalExitBase
1302 CrossDirectionOfParallel( ){ }
1305 class NotThisType
: public NonLocalExitBase