Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[buckminster-dev] Store comments on model

Hello,

I use this example of grammar and I add comments like this:

Model :
	(imports+=Import)*
	(elements+=Type)*;
	
Import :
	'import' importURI=STRING;
	
Type:
	DataType | Class;
	
DataType:
	'datatype' name=ID ';'?;
	
Class :
	'class' name=ID ('extends' superClass=[Class])? '{'
		properties+=Property*
	'}';

Property:
	Attribute | Reference;
	
Attribute:
	'attr' name=ID ':' type=[DataType] ';'?;
	
Reference:
	'ref' name=ID ':' type=[Class] ';'?;
	
terminal ML_COMMENT : 'COMMENTAIRE' !('\n'|'\r')* ('\r'? '\n')?  ;

but when serializing i leave it (that's normal).

I would like to store comments on model for each element defined in my grammar.

Is there a better way to make this?

Thanks




Back to the top