Skip to main content



      Home
Home » Modeling » TMF (Xtext) » how to define grammar for: create package ... end; create package body ... end;
how to define grammar for: create package ... end; create package body ... end; [message #556825] Thu, 02 September 2010 13:49 Go to next message
Eclipse UserFriend
Hello, I thought I would solve this myself, but I've spent several hours and don't see how:

I want to have the grammar for the following:

create package ... end;

create package body ... end;


but my grammar does not work:

it insists to have 'body' after create package

Model:
'CREATE PACKAGE' header=HEADER 'CREATE PACKAGE BODY' body=BODY;

HEADER:
name=ID 'IS' content=PackageHeaderContent end=END name1=ID ';' ('/')?;

BODY:
name=ID 'IS' content=Dummy end=END name1=ID ';' ('/')?;
Re: how to define grammar for: create package ... end; create package body ... end; [message #556827 is a reply to message #556825] Thu, 02 September 2010 13:56 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

don't use keywords with spaces within!

Model:
"CREATE" "PACKAGE" header=HEADER "CREATE" "PACKAGE" "BODY" body=BODY;


Second: The Xtext naming Convestion is to use CamelCase for Parser Rules and not UPPERCASE. UPPERCASE is reseved for terminals.

~Christian

[Updated on: Thu, 02 September 2010 13:56] by Moderator

Re: how to define grammar for: create package ... end; create package body ... end; [message #556832 is a reply to message #556827] Thu, 02 September 2010 14:06 Go to previous message
Eclipse UserFriend
got it! I hope it will help some others too. I'll do my best obeying the conventions
Previous Topic:-- Comments and accept until new line
Next Topic:Question about Xtext Grammar
Goto Forum:
  


Current Time: Mon Oct 27 20:57:56 EDT 2025

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

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

Back to the top