|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Lining up arguments vertically [message #1702765 is a reply to message #1702763] |
Fri, 24 July 2015 13:46 |
Mohsin waqas Messages: 33 Registered: June 2015 |
Member |
|
|
here is the minimal grammar which works good with formatter but do not work with fomatter2
grammar org.xtext.Newproj with org.eclipse.xtext.common.Terminals
generate newproj "http://www.xtext.org/Newproj"
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
//Model:
// greetings+=Greeting*;
//
//Greeting:
// 'Hello' name=ID '!';
NetFile:
((content+=GlobalParameters)|
(content+=LibraryStatement)|
(content+=GlobalDeclaration) );
GlobalParameters:
((name="$config_seprate_file" ) |
(name="$write_ent_fea_sepreatly") ) ";"
;
GlobalDeclaration:
(name="$previoussignal_name" ":" IDENTIFIER ";") |
(name="default_signal_name" ":" IDENTIFIER ";") |
(name="default_vector_type" ":" IDENTIFIER ";")
;
LibraryStatement:
"LIBRARY" name=IDENTIFIER ";" ("USE" (LIBRARY_NAME)*(IDENTIFIER) ";")*
;
terminal IDENTIFIER returns ecore::EString: ('a'..'z'|'A'..'Z') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
terminal LIBRARY_NAME:
IDENTIFIER '.' ;
p.s this grammar is not making any sense because it is a small part of a big grammar.
[Updated on: Fri, 24 July 2015 13:47] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02713 seconds