TPLan2.xtext 18.1 KB
Newer Older
Philip Makedonski's avatar
Philip Makedonski committed
// automatically generated by Xtext
//grammar org.etsi.mts.tdl.TPLan2 with org.eclipse.xtext.common.Terminals
grammar org.etsi.mts.tdl.TPLan2 hidden(WS, ML_COMMENT, SL_COMMENT)

import "http://www.eclipse.org/emf/2002/Ecore" as ecore
//import "http://www.etsi.org/spec/TDL/1.4.0" as tdl
//import "http://www.etsi.org/spec/TDL/1.3.1/structured" as to

import "platform:/resource/org.etsi.mts.tdl.model/model/structured.ecore" as to
import "platform:/resource/org.etsi.mts.tdl.model/model/tdl.ecore" as tdl

//import "http://www.etsi.org/spec/TDL/1.3.1"
//import "http://www.eclipse.org/emf/2002/Ecore" as ecore

Package returns tdl::Package:
    {tdl::Package}
    'Package'
    name=Identifier 
    '{'
		(^import+=ElementImport)*
    
    	//TODO: move to a type of package, similar to group perhaps?
    	('Domain' '{'
	        ('pics' ':' ( packagedElement+=PICS)+';' )?
	        ('entity' 'types' ':' ( packagedElement+=EntityType)+ ';' )?
	        ('entities' ':' ( packagedElement+=Entity)+ ';' )?
	        ('event' 'types' ':' ( packagedElement+=EventType)+ ';' )?
	        ('events' ':' ( packagedElement+=Event)+ ';' )?
	        ('event' 'templates' ':' ( packagedElement+=EventOccurrenceTemplate)+ ';' )?
    	'}')?
    	('Data' '{'
	        (packagedElement+=StructuredDataType)*
	        (packagedElement+=StructuredDataInstance)*
    	'}'
    	)?
    	('Configuration' '{'
	        (packagedElement+=GateType)*
	        (packagedElement+=ComponentType)*
	        (packagedElement+=TestConfiguration)*
    	'}'
    	)?
        (packagedElement+=StructuredTestObjective)*
        (nestedPackage+=Group)*
    '}';


ElementImport returns tdl::ElementImport:
	{tdl::ElementImport}
	'import'
	(	'all'
		|
		(importedElement+=[tdl::PackageableElement|Identifier] ( "," importedElement+=[tdl::PackageableElement|Identifier])*)
	)
	'from' importedPackage=[tdl::Package|Identifier]
	';';

Group returns tdl::Package:
    {tdl::Package}
    'Group'
    name=Identifier
    '{'
        (^import+=ElementImport)*
Philip Makedonski's avatar
Philip Makedonski committed
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737
        (packagedElement+=StructuredTestObjective)*
        (nestedPackage+=Group)*
    '}';

PICS returns to::PICS:
    {to::PICS}
    '-'
    name=Identifier
    ("(" comment+=Qualifier ")")?
    ;

PICSReference returns to::PICSReference :
    (comment+=AndOrQualifier)?
	pics=[to::PICS|Identifier]
;

EntityType returns tdl::AnnotationType:
    {tdl::AnnotationType}
    '-'
    name=Identifier
    ;

Entity returns to::Entity:
    {to::Entity}
    '-'
    name=Identifier
    ('(' annotation+=Annotation (',' annotation+=Annotation)* ')')?
    ;

EventType returns tdl::AnnotationType:
    {tdl::AnnotationType}
    '-'
    name=Identifier
    ;

Annotation returns tdl::Annotation:
    {tdl::Annotation}
    key=[tdl::AnnotationType|Identifier]
    ;

Event returns to::Event:
    {to::Event}
    '-'
    name=Identifier
    ('(' annotation+=Annotation (',' annotation+=Annotation)* ')')?
    ;

EventOccurrenceTemplate returns to::EventSpecificationTemplate:
    {to::EventSpecificationTemplate}
    '-'
    name=Identifier
    '{'
    eventSpecification=EventSpecification
    '}'
    ;


EventSpecification returns to::EventOccurrenceSpecification:
    {to::EventOccurrenceSpecification}
    (entityReference=EntityReference)?
    eventReference=EventReference
	(eventArgument=Argument)?
    (oppositeEntityReference+=OppositeEntityReference (',' oppositeEntityReference+=OppositeEntityReference)* )?
    ;

StructuredTestObjective returns to::StructuredTestObjective:
	{to::StructuredTestObjective}
    'Test Purpose'
    '{'
	    'TP Id' name=Identifier
        'Test objective' description=Identifier 
        ('Reference' objectiveURI+=Identifier (',' objectiveURI+=Identifier )*)?
        ('Config Id' configuration=[tdl::TestConfiguration|Identifier])? 
        ('PICS Selection' picsReference+=PICSReference (picsReference+=PICSReference)*)? 
        (initialConditions=InitialConditions)?
        (expectedBehaviour=ExpectedBehaviour)?
        (finalConditions=FinalConditions)?
    '}';

InitialConditions returns to::InitialConditions:
    name='Initial conditions'
    'with' '{' conditions=EventSequence '}' 
    ;

ExpectedBehaviour returns to::ExpectedBehaviour:
	FullExpectedBehaviour | PartialExpectedBehaviour
;

FullExpectedBehaviour returns to::ExpectedBehaviour:
    name='Expected behaviour'
    'ensure that'
    '{'
       ('when'
           '{'
               whenClause=EventSequence
           '}'
        'then'
           '{'
               thenClause=EventSequence
           '}'
       )
    '}'
    ;

PartialExpectedBehaviour returns to::ExpectedBehaviour:
    name='Expected behaviour'
    'ensure that'
    '{'
       thenClause=EventSequence
    '}'
    ;


FinalConditions returns to::FinalConditions:
    {to::FinalConditions}
    name='Final conditions'
    'with' '{' conditions=EventSequence '}' 
    ;


EventSequence returns to::EventSequence: 
	RepeatedEventSequence | SimpleEventSequence	
;

SimpleEventSequence returns to::EventSequence:
	{to::EventSequence}
    events+=FirstEventOccurrence (events+=EventOccurrence)*  
    ;

RepeatedEventSequence returns to::RepeatedEventSequence:
	{to::RepeatedEventSequence}
	'repeat'
	('every' interval=IterationValue | repetitions=IterationValue 'times')? 
	'{'
    events+=FirstEventOccurrence (events+=EventOccurrence)*
    '}'  
    ;


FirstEventOccurrence returns to::EventOccurrence:
	//TODO: fix
	FirstEventOccurrenceSpecification | FirstEventTemplateOccurrence 
;


EventOccurrence returns to::EventOccurrence:
	EventOccurrenceSpecification | EventTemplateOccurrence
;

FirstEventOccurrenceSpecification returns to::EventOccurrenceSpecification:
    {to::EventOccurrenceSpecification}

    (	(	(timeLabel=TimeLabel 
    			(	(',' timeConstraint=TimeConstraint)
    				| ':'
    			)
    		) 
    		| 
    		(timeConstraint=TimeConstraint)
		)
    )?
    (entityReference=EntityReference)?
    eventReference=EventReference
	(eventArgument=Argument)?
    (oppositeEntityReference+=OppositeEntityReference (',' oppositeEntityReference+=OppositeEntityReference)* )?
    (comment+=Note)*
;

FirstEventTemplateOccurrence returns to::EventTemplateOccurrence:
    {to::EventTemplateOccurrence}

    (	(	(timeLabel=TimeLabel 
    			(	(',' timeConstraint=TimeConstraint)
    				| ':'
    			)
    		) 
    		| 
    		(timeConstraint=TimeConstraint)
		)
    )?
    'event' 
    eventTemplate=[to::EventSpecificationTemplate|Identifier]
    'occurs'
    ('with' 
    '{'
    	(entityBinding+=EntityBinding (',' entityBinding+=EntityBinding)*)?
		('argument' 'replaced' 'by' occurrenceArgument=Argument)?
    	
    '}'
    )?
    (comment+=Note)*
;

EntityBinding returns to::EntityBinding:
	templateEntity=EntityReference
	'replaced' 'by'
	occurrenceEntity=EntityReference
;


Note returns tdl::Comment:
	'('
	'Note'
	name=NumberAsIdentifier
	':'
	body=Identifier
	')'
;

EventOccurrenceSpecification returns to::EventOccurrenceSpecification:
    {to::EventOccurrenceSpecification}
    comment+=AndOrQualifier
    (		(timeLabel=TimeLabel 
    			(	(',' timeConstraint=TimeConstraint)
    				| ':'
    			)
    		) 
    		| 
    		(timeConstraint=TimeConstraint)
		
    )?
    (entityReference=EntityReference)?
    eventReference=EventReference
	(eventArgument=Argument)?
    (oppositeEntityReference+=OppositeEntityReference (',' oppositeEntityReference+=OppositeEntityReference)* )?
    (comment+=Note)*
    ;

EventTemplateOccurrence returns to::EventTemplateOccurrence:
    {to::EventTemplateOccurrence}
    comment+=AndOrQualifier
    (		(timeLabel=TimeLabel 
    			(	(',' timeConstraint=TimeConstraint)
    				| ':'
    			)
    		) 
    		| 
    		(timeConstraint=TimeConstraint)
		
    )?
    'event' 
    eventTemplate=[to::EventSpecificationTemplate|Identifier]
    'occurs'
    ('with' 
    '{'
    	(entityBinding+=EntityBinding (',' entityBinding+=EntityBinding)*)?
		('argument' 'replaced' 'by' occurrenceArgument=Argument)?
    	
    '}'
    )?
    (comment+=Note)*
    ;


TimeLabel returns tdl::TimeLabel:
	{tdl::TimeLabel}
	'(.)' 'at' 'time' 'point' 
	name=Identifier
;

TimeConstraint returns tdl::TimeConstraint:
	{tdl::TimeConstraint}
	'(!)' 
	(comment+=Qualifier)*
	comment+=TimeConstraintQualifier
	(comment+=Qualifier | comment+=CommonWordQualifier | comment+=ArticleQualifier)*
	timeConstraintExpression=TimeConstraintExpression
	':'
;

TimeConstraintExpression returns tdl::DataUse:
    //TODO: formalize further? make use of predefined data instances? need complex syntax for that
	//TODO: check the scope of the integration and what is really needed
//	dataInstance=[TimeLabel|Identifier]
//	dataInstance=[DataInstance|Identifier]
	ConstraintTimeLabelUse | ConstraintDataInstanceUse
	//('with' argument+=ArgumentSpecification ( "," argument+=ArgumentSpecification)* )?
;


ConstraintDataInstanceUse returns tdl::DataInstanceUse:
	( dataInstance=[tdl::DataInstance|Identifier] | dataInstance=[tdl::DataInstance|NumberAsIdentifier] )
	;
ConstraintTimeLabelUse returns tdl::TimeLabelUse:
	( timeLabel=[tdl::TimeLabel|Identifier])
	;



TimeConstraintQualifier returns tdl::Comment:
    {tdl::Comment}
    (body='before' | body='after' | body='during' | body='within' )
    ;
    
EntityReference returns to::EntityReference:
    {to::EntityReference}
    (comment+=ArticleQualifier)
    (comment+=Qualifier)*
    (
    	(entity=[to::Entity|Identifier] 'entity')
      | (component=[tdl::ComponentInstance|Identifier] 'component')
    )
    ;
    
OppositeEntityReference returns to::EntityReference:
    {to::EntityReference}
    (comment+=DirectionQualifier)
    (comment+=ArticleQualifier)
    (comment+=Qualifier)*
    (
    	(entity=[to::Entity|Identifier] 'entity')
      | (component=[tdl::ComponentInstance|Identifier] 'component')
    )
    ;

EventReference returns to::EventReference:
    {to::EventReference}
    (comment+=Qualifier | comment+=CommonWordQualifier)*
    event=[to::Event|Identifier] 
    ;

Argument returns to::Value:
	LiteralValueAsArgument |
	TypedLiteralValueAsArgument |
	DataReferenceAsArgument |
	ContentReferenceAsArgument |
	LiteralValueReferenceArgument
;

Value returns to::Value:
    LiteralValue | 
  	DataReference | 
    ContentReference | 
    LiteralValueReference;

TypedValue returns to::Value:
    TypedLiteralValue | 
  	DataReference | 
    ContentReference | 
    LiteralValueReference
    //TODO: need for parameter reference?
    ;

IterationValue returns to::Value:
    IterationLiteralValue | 
  	IterationDataReference
  	;


    
TypedLiteralValueAsArgument returns to::LiteralValue:
    {to::LiteralValue}
    (comment+=ArticleQualifier
        | comment+=QuantifiedQualifier
    )
	'(typed)'
    (comment+=Qualifier)* 
    (name=Identifier | name=NumberAsIdentifier)
	dataType=[tdl::DataType|Identifier]
    ('containing' content+=TypedDataContent (',' content+=TypedDataContent)* ';')?
    ;


TypedLiteralValue returns to::LiteralValue:
    {to::LiteralValue}
    comment+=AssignmentQualifier 
    (comment+=Qualifier)* 
	(name=Identifier | name=NumberAsIdentifier)
	//data type?
	('containing' content+=TypedDataContent (',' content+=TypedDataContent)* ';')?
    ;

TypedDataContent returns to::Content:
	{to::Content}
    (comment+=Qualifier)*
    member=[tdl::Member|Identifier]
    (
	    ('containing' content+=TypedDataContent (',' content+=TypedDataContent)* ';')
    	|
		(value=TypedValue)
	)?
    ;

LiteralValueAsArgument returns to::LiteralValue:
    {to::LiteralValue}
    (comment+=ArticleQualifier
        | comment+=QuantifiedQualifier
    )
//	'(literal)'
    (comment+=Qualifier)* 
    (name=Identifier | name=NumberAsIdentifier)
    ('containing' content+=DataContent (',' content+=DataContent)* ';')?
    ;

LiteralValue returns to::LiteralValue:
    {to::LiteralValue}
    comment+=AssignmentQualifier 
    (comment+=Qualifier)* 
	(name=Identifier | name=NumberAsIdentifier)
	('containing' content+=DataContent (',' content+=DataContent)* ';')?
    ;

IterationLiteralValue returns to::LiteralValue:
    {to::LiteralValue}
	(name=Identifier | name=NumberAsIdentifier)
    ;

IterationDataReference returns to::DataReference:
   	content=RepetitionDataInstanceUse
    ;



DataContent returns to::Content:
	{to::Content}
    (comment+=Qualifier)*
    //(parameter=[Parameter|Identifier] | name=Identifier | name=NumberAsIdentifier)
    (name=Identifier | name=NumberAsIdentifier)
    (
	    ('containing' content+=DataContent (',' content+=DataContent)* ';')
    	|
		(value=Value)
	)?
    ;

Identifier returns ecore::EString:
    STRING | ID;

Qualifier returns tdl::Comment:
    body=Identifier | body=NumberAsIdentifier
    ;

CommonWordQualifier returns tdl::Comment:
	body='before' | body='after' | body='from' | body='to' | body='of'
;

ArticleQualifier returns tdl::Comment:
    (body='a' | body='an' | body='the')
    ;

QuantifiedQualifier returns tdl::Comment:
    (body='all' | body='any' | body='few' | body='multiple' | body='no' | body='only' | body='several' | body='some')
    ;

AssignmentQualifier returns tdl::Comment:
	(body='indicating value' | body='set to')
;

AndOrQualifier returns tdl::Comment:
    (body='and' | body='or')
    ;

DirectionQualifier returns tdl::Comment:
    (	body='by' |
    	body='in' |
    	body='into' |
    	body='for' | 
    	body='from' | 
    	body='to'
    )
    ;

ReferenceQualifier returns tdl::Comment:
    (body='corresponding to' | body='derived from' | body='carrying'  | body='contained in' | body='associated with')
    ;

DataInstanceUse returns tdl::DataInstanceUse:
	( dataInstance=[tdl::DataInstance|Identifier]
		| dataInstance=[tdl::DataInstance|NumberAsIdentifier]
	)
	('containing' argument+=ParameterBinding ( ',' argument+=ParameterBinding)* ';')?
	;

RepetitionDataInstanceUse returns tdl::DataInstanceUse:
	( dataInstance=[tdl::DataInstance|Identifier] | dataInstance=[tdl::DataInstance|NumberAsIdentifier])
	;


StaticDataUse returns tdl::StaticDataUse:
	DataInstanceUse | AnyValue | AnyValueOrOmit | OmitValue;

AnyValue returns tdl::AnyValue:
	'any'
	dataType=[tdl::DataType|Identifier]
	;

AnyValueOrOmit returns tdl::AnyValueOrOmit:
	{tdl::AnyValueOrOmit}
	'any' 'or' 'omitted'
	;

OmitValue returns tdl::OmitValue:
	{tdl::OmitValue}
	'omitted'
;

ParameterBinding returns tdl::ParameterBinding:
	parameter=[tdl::Parameter|Identifier]
	comment+=AssignmentQualifier 
    (comment+=Qualifier)*
	dataUse=StaticDataUse
	;

ContentReference returns to::ContentReference:
   	comment+=ReferenceQualifier
   	'the' 'value' 'contained in' 
   	//make more complex: simplify
   	//e.g. 
    //(comment+=ArticleQualifier)?
    //(comment+=Qualifier)*
	//(name=Identifier | name='value')
   	//comment+=ReferenceQualifier
   	(comment+=Qualifier)*
   	content=[to::Content|Identifier]
    ;

LiteralValueReference returns to::LiteralValueReference:
   	comment+=ReferenceQualifier
   	'the' 'value' 'of'
    (comment+=Qualifier)*
   	content=[to::LiteralValue|Identifier]
    ;

ContentReferenceAsArgument returns to::ContentReference:
   	'the' 'value' 'contained in' 
    (comment+=Qualifier)*
   	content=[to::Content|Identifier]
    ;

LiteralValueReferenceArgument returns to::LiteralValueReference:
   	'the' 'value' 'of'
    (comment+=Qualifier)*
   	content=[to::LiteralValue|Identifier]
    ;

DataReference returns to::DataReference:
    (name=Identifier)?
    comment+=ReferenceQualifier
    (comment+=Qualifier)*
   	content=StaticDataUse
    ;

DataReferenceAsArgument returns to::DataReference:
    (comment+=ArticleQualifier 
    	| comment+=QuantifiedQualifier
    )
	'(predefined)'    
    (comment+=Qualifier)*
    //name=Identifier
    content=StaticDataUse
;

NumberAsIdentifier returns ecore::EString:
    '-'? INT ('.' INT)?;

StructuredDataType returns tdl::StructuredDataType:
	{tdl::StructuredDataType}
	'type'
	name=Identifier
	('with' member+=Member ( "," member+=Member)* )?
    ';';

Member returns tdl::Member:
	(isOptional?='optional')?
	name=Identifier
	'of' 'type'
	dataType=[tdl::DataType|Identifier]
	;

Optional returns ecore::EBoolean :
	'optional'
;

StructuredDataInstance returns tdl::StructuredDataInstance:
	{tdl::StructuredDataInstance}
	dataType=[tdl::DataType|Identifier]
	(name=Identifier | name=NumberAsIdentifier)
	('containing' memberAssignment+=MemberAssignment (',' memberAssignment+=MemberAssignment)* )?		
	';'
	;

MemberAssignment returns tdl::MemberAssignment:
	member=[tdl::Member|Identifier]
	comment+=AssignmentQualifier
	memberSpec=StaticDataUse
;


TestConfiguration returns tdl::TestConfiguration:
	'Test Configuration'
		name=Identifier
	'containing'
		componentInstance+=ComponentInstance (componentInstance+=ComponentInstance)* 
		connection+=Connection (connection+=Connection)* 
	';'
	;

ComponentInstance returns tdl::ComponentInstance:
	role=ComponentInstanceRole
	'component'
	name=Identifier
	'of' 'type' type=[tdl::ComponentType|Identifier]
	;

enum ComponentInstanceRole returns tdl::ComponentInstanceRole:
	SUT = 'SUT' | Tester = 'Tester';

Connection returns tdl::Connection:
	'connection'
	'between'
	endPoint+=GateReference "and" endPoint+=GateReference  
;

GateReference returns tdl::GateReference:
	component=[tdl::ComponentInstance|Identifier]
	'.'
	gate=[tdl::GateInstance|Identifier]
;

GateType returns tdl::GateType:
	'Interface' 'Type'
	name=Identifier
	'accepts'
		dataType+=[tdl::DataType|Identifier] ( "," dataType+=[tdl::DataType|Identifier])*  
	';';

ComponentType returns tdl::ComponentType:
	{tdl::ComponentType}
	'Component' 'Type'
	name=Identifier
	'with' 
		(timer+=Timer)*
		(variable+=Variable)* 
		(gateInstance+=GateInstance)* 
	';'
;

Timer returns tdl::Timer:
	{tdl::Timer}
	'timer'
	name=Identifier
	;

Variable returns tdl::Variable:
	'variable'
	name=Identifier
	'of' 'type'
	dataType=[tdl::DataType|Identifier]
	;

GateInstance returns tdl::GateInstance:
	{tdl::GateInstance}
	'gate'
	name=Identifier
	'of' 'type' type=[tdl::GateType|Identifier]
	;


    
terminal ID         : '^'?('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9'|'/')*;
terminal INT returns ecore::EInt: ('0'..'9')+;
terminal SQ : '"';
terminal DQ : "'";
terminal STRING : 
            DQ ( '\\' ('b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\') | !('\\'|DQ) )* DQ |
            SQ ( '\\' ('b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\') | !('\\'|SQ) )* SQ
        ; 
terminal ML_COMMENT : '/*' -> '*/';
terminal SL_COMMENT     : '//' !('\n'|'\r')* ('\r'? '\n')?;

//terminal NL         : ('\n');

terminal WS         : (' '|'\t'|'\r'|'\n')+;

terminal ANY_OTHER: .;