-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #160 from nickovic/155-exceptions
155 exceptions
- Loading branch information
Showing
35 changed files
with
155 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
from antlr4.error.ErrorListener import ErrorListener | ||
from rtamt.exception.ltl.exception import LTLParseException | ||
from rtamt.exception.exception import RTAMTException | ||
|
||
class LTLParserErrorListener( ErrorListener ): | ||
def syntaxError(self, recognizer, offendingSymbol, line, column, msg, e): | ||
raise LTLParseException (str(line) + ":" + str(column) + ": Syntax ERROR, " + str(msg)) | ||
raise RTAMTException (str(line) + ":" + str(column) + ": Syntax ERROR, " + str(msg)) | ||
|
||
def reportAmbiguity(self, recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs): | ||
raise LTLParseException("Ambiguity ERROR, " + str(configs)) | ||
raise RTAMTException("Ambiguity ERROR, " + str(configs)) | ||
|
||
def reportAttemptingFullContext(self, recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs): | ||
raise LTLParseException("Attempting full context ERROR, " + str(configs)) | ||
raise RTAMTException("Attempting full context ERROR, " + str(configs)) | ||
|
||
def reportContextSensitivity(self, recognizer, dfa, startIndex, stopIndex, prediction, configs): | ||
raise LTLParseException("Context ERROR, " + str(configs)) | ||
raise RTAMTException("Context ERROR, " + str(configs)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
from antlr4.error.ErrorListener import ErrorListener | ||
from rtamt.exception.stl.exception import STLParseException | ||
from rtamt.exception.exception import RTAMTException | ||
|
||
class STLParserErrorListener( ErrorListener ): | ||
def syntaxError(self, recognizer, offendingSymbol, line, column, msg, e): | ||
raise STLParseException (str(line) + ":" + str(column) + ": Syntax ERROR, " + str(msg)) | ||
raise RTAMTException (str(line) + ":" + str(column) + ": Syntax ERROR, " + str(msg)) | ||
|
||
def reportAmbiguity(self, recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs): | ||
raise STLParseException("Ambiguity ERROR, " + str(configs)) | ||
raise RTAMTException("Ambiguity ERROR, " + str(configs)) | ||
|
||
def reportAttemptingFullContext(self, recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs): | ||
raise STLParseException("Attempting full context ERROR, " + str(configs)) | ||
raise RTAMTException("Attempting full context ERROR, " + str(configs)) | ||
|
||
def reportContextSensitivity(self, recognizer, dfa, startIndex, stopIndex, prediction, configs): | ||
raise STLParseException("Context ERROR, " + str(configs)) | ||
raise RTAMTException("Context ERROR, " + str(configs)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
class RTAMTException(Exception): | ||
pass | ||
def __init__(self, *args): | ||
if args: | ||
self.message = args[0] | ||
else: | ||
self.message = None | ||
|
||
class AstVisitorException(RTAMTException): | ||
pass | ||
def __str__(self): | ||
if self.message: | ||
return 'RTAMT Exception: {0} '.format(self.message) | ||
else: | ||
return 'RTAMT Exception has been raised' | ||
|
||
class AstParseException(RTAMTException): | ||
pass |
Empty file.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.