|
Re: Xtext definition and instance in same grammar [message #1302547 is a reply to message #1302094] |
Fri, 18 April 2014 20:18 |
Ed Merks Messages: 33108 Registered: July 2009 |
Senior Member |
|
|
Christophe,
You seem to have hit the wrong newsgroup again...
On 18/04/2014 4:07 PM, Christophe Bouhier wrote:
> Hi,
>
> I have this grammar which has definition of types and instance of them
> in the same grammar.
>
>
> This would be the type definition or Macro in this case:
>
> *********
>
> OBJECT-IDENTITY MACRO ::=
> BEGIN
> TYPE NOTATION ::=
> "STATUS" Status
> "DESCRIPTION" Text
>
> VALUE NOTATION ::=
> value(VALUE OBJECT IDENTIFIER)
>
> Status ::=
> "current"
> | "deprecated"
> | "obsolete"
>
> ReferPart ::=
> "REFERENCE" Text
> | empty
>
> -- a character string as defined in section 3.1.1
> Text ::= value(IA5String)
> END
>
> *********
>
> ...and further down an instanceof of it. How do I deal with this?
> I can reference the [MACRO] of course, but how does the parser know
> the possible attributes and values for the Macro type? Do I need
> parser rules in code?
>
>
> ******************
>
> zeroDotZero OBJECT-IDENTITY
> STATUS current
> DESCRIPTION
> "A value used for null identifiers."
> ::= { 0 0 }
>
> **********************
>
> Thanks ! Christophe
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.01947 seconds