riaps@riapsvbox:~/riaps-tests/temp$ riaps_lang A.riaps
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/textx/model.py", line 153, in _parse
return self.parser_model.parse(self)
File "/usr/local/lib/python3.5/dist-packages/arpeggio/__init__.py", line 283, in parse
result = self._parse(parser)
File "/usr/local/lib/python3.5/dist-packages/arpeggio/__init__.py", line 362, in _parse
result = e.parse(parser)
File "/usr/local/lib/python3.5/dist-packages/arpeggio/__init__.py", line 768, in parse
result = self._parse(parser)
File "/usr/local/lib/python3.5/dist-packages/arpeggio/__init__.py", line 920, in _parse
parser._nm_raise(self, c_pos, parser)
File "/usr/local/lib/python3.5/dist-packages/arpeggio/__init__.py", line 1672, in _nm_raise
raise self.nm
File "/usr/local/lib/python3.5/dist-packages/arpeggio/__init__.py", line 463, in _parse
result = p(parser)
File "/usr/local/lib/python3.5/dist-packages/arpeggio/__init__.py", line 283, in parse
result = self._parse(parser)
File "/usr/local/lib/python3.5/dist-packages/arpeggio/__init__.py", line 362, in _parse
result = e.parse(parser)
File "/usr/local/lib/python3.5/dist-packages/arpeggio/__init__.py", line 283, in parse
result = self._parse(parser)
File "/usr/local/lib/python3.5/dist-packages/arpeggio/__init__.py", line 507, in _parse
result = p(parser)
File "/usr/local/lib/python3.5/dist-packages/arpeggio/__init__.py", line 283, in parse
result = self._parse(parser)
File "/usr/local/lib/python3.5/dist-packages/arpeggio/__init__.py", line 362, in _parse
result = e.parse(parser)
File "/usr/local/lib/python3.5/dist-packages/arpeggio/__init__.py", line 768, in parse
result = self._parse(parser)
File "/usr/local/lib/python3.5/dist-packages/arpeggio/__init__.py", line 874, in _parse
parser._nm_raise(self, c_pos, parser)
File "/usr/local/lib/python3.5/dist-packages/arpeggio/__init__.py", line 1672, in _nm_raise
raise self.nm
arpeggio.NoMatch: Expected 'message' at position /home/riaps/riaps-tests/temp/A.riaps:(5, 3) => 'ssary; *component '.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/riaps/lang/lang.py", line 429, in compileModel
example_riaps_model = riaps_meta.model_from_file(join(this_folder,modelFileName))
File "/usr/local/lib/python3.5/dist-packages/textx/metamodel.py", line 465, in model_from_file
encoding, debug=debug)
File "/usr/local/lib/python3.5/dist-packages/textx/model.py", line 168, in get_model_from_file
debug=debug)
File "/usr/local/lib/python3.5/dist-packages/textx/model.py", line 191, in get_model_from_str
self.parse(model_str, file_name=file_name)
File "/usr/local/lib/python3.5/dist-packages/arpeggio/__init__.py", line 1470, in parse
self.parse_tree = self._parse()
File "/usr/local/lib/python3.5/dist-packages/textx/model.py", line 156, in _parse
raise TextXSyntaxError(text(e), line, col)
textx.exceptions.TextXSyntaxError: Expected 'message' at position /home/riaps/riaps-tests/temp/A.riaps:(5, 3) => 'ssary; *component '.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/riaps_lang", line 15, in <module>
main()
File "/usr/local/lib/python3.5/dist-packages/riaps/lang/lang.py", line 475, in main
return compileModel(args.model,args.verbose)
File "/usr/local/lib/python3.5/dist-packages/riaps/lang/lang.py", line 437, in compileModel
raise LangError(errMsg)
riaps.lang.lang.LangError: Syntax error: Expected 'message' at position /home/riaps/riaps-tests/temp/A.riaps:(5, 3) => 'ssary; *component '.
Uncommenting message Unnecessary lets the app compile and run as expected. I think we should allow the user to create apps that don't need any messages.
For fun, here is the component code and .depl:
# import riaps
from riaps.run.comp import Component
import logging
import random
import os
import time
# CPU limited component
class A(Component):
def __init__(self):
super(A, self).__init__()
self.pid = os.getpid()
logpath = '/tmp/CompA.log'
try:
os.remove(logpath)
except OSError:
pass
self.fh = logging.FileHandler(logpath)
self.fh.setLevel(logging.DEBUG)
self.fh.setFormatter(self.logformatter)
self.logger.addHandler(self.fh)
self.logger.info("Started A")
def on_clock(self):
msg = self.clock.recv_pyobj()
self.logger.info("Time: %s" % msg)
riaps_lang produces the following error:
For the following .riaps file:
Uncommenting
message Unnecessary
lets the app compile and run as expected. I think we should allow the user to create apps that don't need any messages.For fun, here is the component code and .depl: