Book a Demo

Author Topic: EA Grammer Example causes Parse error  (Read 4186 times)

GeKo

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
EA Grammer Example causes Parse error
« on: December 19, 2013, 01:49:55 am »
When using SSL.nbnf as the grammer for an MDG based example language it causes a "Parse Error on line 21" in the Structure Tree of test.ssl when opening it with "View source Code". Parsing test.ssl with SSL.nbnf in Grammer Debugger finishes without errors.

1. Any tips to resolve the problem?
2. Which AST structure is required to "View Source Code" including fields or to "Synchronize with Sourcecode" all methods and field?
3. Which AST structure is required to reverse engineer method and field access into dependencies?

By the way: Synchronizing test.ssl with SSL.nbnf causes empty constructors and destructors. I fixed this using the operation syntax as a template.    
  

GeKo

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
EA Grammer Example causes Parse error - Update
« Reply #1 on: December 20, 2013, 12:57:50 am »
The parsing error shows up as long as a field definitions has a scope diffrent from "public". Using "protected" or "private" causes the error.
This is quite independent of the AST Strukture.

BUG: It ist not possible to synchronize private or protected fields in languages added by MDG. EA 10.0.1005.

Thanks for help in advance.


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: EA Grammer Example causes Parse error - Update
« Reply #2 on: December 20, 2013, 05:17:16 am »
You should contact Sparx support directly. There's only one guy from Sweden who actively uses EA grammar definition (at least an active poster).

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: EA Grammer Example causes Parse error
« Reply #3 on: December 20, 2013, 08:53:56 am »
I've just opened the grammar editor with the sample grammar and sample source.

It parsed the file correctly. It sounds like you are using a modified grammar (even if you didn't realise it had been changed)

The rule for attribute scope should read
Code: [Select]
<attributeVisibility> ::= attribute("SCOPE", "public") |
                                                  attribute("SCOPE", "protected") |
                                                  attribute("SCOPE", "private") |
                                                  attributeEx("SCOPE", "public");

I'd be surprised if you couldn't import any private attributes using this method. That would mean that you couldn't do it for even the supported languages (which work in much the same way)

GeKo

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: EA Grammer Example causes Parse error
« Reply #4 on: December 20, 2013, 06:11:42 pm »
Thanks for Your replies. I will contact support directly.

Simon: The Grammer Editor works fine for the example file. The problem shows up as soon as you convert the grammar into a MDG Technology using the wizard for a "new" language . If you attach the example file to a class and open the example file in source window (F12), the structure tree of the source window states an error and it is not possible to sync the example file with the class. As soon as you remove "private" or replace it by "public" everything works fine.

g.