Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » SMI (ASN1) grammar
SMI (ASN1) grammar [message #1007711] Thu, 07 February 2013 08:48 Go to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hello There,

I am creating an editor for the SMI format. See:
http://en.wikipedia.org/wiki/Structure_of_Management_Information

It's used to define so called MIB's used by the SNMP protocol. The SMI format is based on ASN1.
There is a antlr version of the grammar as a starting point, but that is horrifically intimidating Smile

http://www.antlr3.org/grammar/1105770765162/parsesmi-v1-15jan05.zip

Does anyone has a base ASN1 Xtext grammar or even better SMI? If not, would anyone like to cooperate on this? Or help translate the antlr grammar?

For example in ANTLR, this grammar as a bunch of tokens as :

tokens {
	
ABSENT_KW = "ABSENT" ;
ABSTRACT_SYNTAX_KW = "ABSTRACT-SYNTAX" ;
ALL_KW= "ALL" ;
ANY_KW = "ANY" ;
ARGUMENT_KW = "ARGUMENT" ;
APPLICATION_KW = "APPLICATION" ;
AUTOMATIC_KW = "AUTOMATIC" ;
BASED_NUM_KW = "BASEDNUM" ;
BEGIN_KW = "BEGIN" ;
BIT_KW = "BIT" ;
BMP_STRING_KW = "BMPString" ;
...
}


How do I convert this to Xtext? Are these literals which can be put in an enum?
I will be facing more of these issues, and need help.

Thank You.
Christophe Bouhier
Re: SMI (ASN1) grammar [message #1007977 is a reply to message #1007711] Fri, 08 February 2013 07:24 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 2961
Registered: July 2009
Senior Member
Hi Christophe,

those token definitions can be translates as plain keywords.

>> I will be facing more of these issues, and need help.

See the footer ;-)

Best regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 07.02.13 09:48, schrieb Christophe Bouhier:
> Hello There,
> I am creating an editor for the SMI format. See:
> http://en.wikipedia.org/wiki/Structure_of_Management_Information
>
> It's used to define so called MIB's used by the SNMP protocol. The SMI
> format is based on ASN1. There is a antlr version of the grammar as a
> starting point, but that is horrifically intimidating :)
> http://www.antlr3.org/grammar/1105770765162/parsesmi-v1-15jan05.zip
>
> Does anyone has a base ASN1 Xtext grammar or even better SMI? If not,
> would anyone like to cooperate on this? Or help translate the antlr
> grammar?
> For example in ANTLR, this grammar as a bunch of tokens as :
> tokens {
>
> ABSENT_KW = "ABSENT" ;
> ABSTRACT_SYNTAX_KW = "ABSTRACT-SYNTAX" ;
> ALL_KW= "ALL" ;
> ANY_KW = "ANY" ;
> ARGUMENT_KW = "ARGUMENT" ;
> APPLICATION_KW = "APPLICATION" ;
> AUTOMATIC_KW = "AUTOMATIC" ;
> BASED_NUM_KW = "BASEDNUM" ;
> BEGIN_KW = "BEGIN" ;
> BIT_KW = "BIT" ;
> BMP_STRING_KW = "BMPString" ;
> ..
> }
>
> How do I convert this to Xtext? Are these literals which can be put in
> an enum? I will be facing more of these issues, and need help.
> Thank You. Christophe Bouhier
Re: SMI (ASN1) grammar [message #1008055 is a reply to message #1007977] Fri, 08 February 2013 16:31 Go to previous message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi Sebastian,

Thanks for offering me to pay you Wink

Anyway, I made a start and quiet happy with the result sofar (At least it compiles). Anyplace where we share xtext grammars?

rgds Christophe
  • Attachment: Smi.xtext
    (Size: 7.78KB, Downloaded 85 times)
Previous Topic:beginner question
Next Topic:Xtext/Xtend is not resolving binary operations properly
Goto Forum:
  


Current Time: Sat Dec 20 08:51:23 GMT 2014

Powered by FUDForum. Page generated in 0.02057 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software