Stratego/XT JIRA  History | Log In     View a printable version of the current page. Get help!  
Issue Details (XML | Word)

Key: STR-549
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Trivial Trivial
Assignee: Martin Bravenboer
Reporter: Eelco Dolstra
Votes: 0
Watchers: 0
Operations

Clone this issue
Create sub-task
If you were logged in you would be able to see more operations.
Stratego/XT

sglri does not print an error message if the parse table is bad

Created: 2006-04-06 15:23   Updated: 2008-03-31 20:46
Component/s: None
Affects Version/s: None
Fix Version/s: 0.17

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
For example, I did

$ sglri -p PHP.def < example.php

$ echo $?
1

Of course, PHP.def should have been PHP.tbl. But sglri should at least print out an error message.

Strangely, it doesn't to this for all files. Usually it just gives an ATerm error:

$ sglri -p /dev/null
readFromTextFile: parse error at line 0, col 0
not a valid term


 All   Comments   Work Log   Change History      Sort Order:
Martin Bravenboer [2006-06-02 14:38]
This is because a prefix of PHP.def was probably a valid aterm and was read as such, but of course wasn't a valid parse table term.

We'll need to do something with a failed open-parse-table in sglri.

Martin Bravenboer [2006-07-02 00:18]
Valid aterm prefix:

martin@linux:~/tmp> cat bar.def
definition
martin@linux:~/tmp> sglri -i Foo2.java -p bar.def
[ sglri | critical ] The specified parse table file does not contain a parse table

Not a valid aterm prefix:

martin@linux:~/tmp> cat foo.def
#%^**#$^
martin@linux:~/tmp> sglri -i Foo2.java -p foo.def
readFromTextFile: parse error at line 0, col 0
not a valid term
[ sglri | critical ] Could not open parse table