Details
Description
Se below for a working example of sablecc grammar that allows comments starting with '#'. Please make a more robust grammar if you implement this improvement.
...
Helpers
letter = [['a'..'z'] + ['A'..'Z']];
digit = ['0'..'9'];
space = ' ';
tab = 9;
cr = 13;
lf = 10;
endl = cr | lf | cr lf;
commentchar = '#';
specialchar = '/' | '?' | '-' | '.' | '*' | '(' | ')';
norwegianchar = ''|''|''|''|''|'';
commentchars = space | tab | letter | digit | specialchar | norwegianchar;
Tokens
title_keyword = 'Title:';
scenario_keyword = 'Scenario:';
as_a = 'As a';
i_want = 'I want';
so_that = 'So that';
given = 'Given';
when = 'When';
then = 'Then';
space = space;
word = letter+;
endl = endl;
commentline = commentchar commentchars* endl;
Ignored Tokens
commentline;
Productions
story =
title
role?
feature?
benefit?
scenario*;
...
Activity
Field | Original Value | New Value |
---|---|---|
Assignee | Mauro Talevi [ maurotalevi ] |
Fix Version/s | 1.1 [ 13339 ] |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Component/s | Core [ 11086 ] | |
Component/s | Story runner [ 11084 ] |
Eric - applied patch and rebuilt sablecc generator code.
Added a behaviour to verify the use of comments.
What do you mean by "Please make a more robust grammar if you implement this improvement." Can you elaborate?
Thanks