Skip to content

Commit 3f24c27

Browse files
authored
Merge pull request #8 from mthom/c_style_comment_blocks
add support for C-style comment blocks
2 parents f80241d + eb0c1db commit 3f24c27

File tree

1 file changed

+13
-1
lines changed
  • PSOACore/src/main/antlr3/org/ruleml/psoa/parser

1 file changed

+13
-1
lines changed

PSOACore/src/main/antlr3/org/ruleml/psoa/parser/PSOAPS.g

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ tokens
4343
package org.ruleml.psoa.parser;
4444
}
4545

46+
@lexer::members {
47+
private boolean printDeprecatedCommentWarning = true;
48+
}
49+
4650
@members
4751
{
4852
private List<String[]> m_imports = new ArrayList<String[]>();
@@ -439,7 +443,15 @@ curie returns [String fullIRI]
439443
// Comments and whitespace:
440444
WHITESPACE : (' '|'\t'|'\r'|'\n')+ { $channel = HIDDEN; } ;
441445
COMMENT : '%' ~('\n')* { $channel = HIDDEN; } ;
442-
MULTI_LINE_COMMENT : '<!--' (options {greedy=false;} : .* ) '-->' { $channel=HIDDEN; } ;
446+
MULTI_LINE_COMMENT : '<!--' (options {greedy=false;} : .* ) '-->'
447+
{ $channel=HIDDEN; }
448+
{
449+
if (printDeprecatedCommentWarning) {
450+
System.out.println("Warning: XML-style comment blocks (delimited by '<!--'/'-->') are now deprecated and will be removed in a future release.");
451+
printDeprecatedCommentWarning = false;
452+
}
453+
}
454+
| '/*' (options {greedy=false;} : .*) '*/' { $channel=HIDDEN; } ;
443455

444456
// Keywords:
445457
DOCUMENT : 'Document' | 'RuleML' ;

0 commit comments

Comments
 (0)