Application freezes when typing an undefined terminal [message #1729776] |
Mon, 18 April 2016 16:43  |
Eclipse User |
|
|
|
I am having trouble with a grammar which does not include the standard terminals. If I type any character in the editor which is not defined in a terminal, the Eclipse application hangs completely!
What is the easiest solution to avoid this?
The grammar is as follows (note I had to remove the URLs before Eclipse would allow me to post it!):
grammar org.lilychant.LilyChant hidden(WS, ML_COMMENT, SL_COMMENT)
<...>
generate lilyChantScript <...>
Script:
(
(tones+=Tone)+
// ensemble=Ensemble
(chants+=Chant)*
)?
;
/*
* Tone definitions
*/
// TODO VOICE NAMES SHOULD BE GLOBAL
Tone:
'Tone' name=ID 'in' key=ID
BEGIN
'Voices'
BEGIN
voiceNames+=VoiceName+
END
(phrases+=TonePhrase)+
END
;
VoiceName:
name=ID
;
TonePhrase:
'Phrase' name=ID
BEGIN
voices+=VoicePhrase+
END
;
VoicePhrase:
'Voice' name=[VoiceName]
BEGIN
notes+=Note+
END
;
///*
// * Ensemble
// */
//
//Ensemble:
// 'ensemble' ':'
// 'top' 'staff' ':' BEGIN voices+=[VoiceName]+ END
// 'bottom' 'staff' ':' BEGIN voices+=[VoiceName]+ END
//;
/*
* Chants
*/
Chant:
'Chant' 'in' 'Tone' tone=[Tone] 'in' key=ID
BEGIN
phrases+=LyricPhrase+
END
;
LyricPhrase:
'Phrase' notes=[TonePhrase]
BEGIN
noteGroups+=NoteGroup+
END
;
NoteGroup:
// single syllable
// '--' is allowed at the start to support exiting a '<...>' group in the middle of a word
(syllables+=ID =>(syllables+=HYPHEN)?
| syllables+=HYPHEN syllables+=ID)
syllables+=EXTENDER?
// syllables+=HYPHEN? syllables+=ID =>syllables+=HYPHEN? syllables+=EXTENDER*
// | syllables+=ID syllables+=HYPHEN? syllables+=EXTENDER*
// group of syllables to be repeated on the same pitch
// Note that '__' is not allowed within a group, as this implies a slur
| START_NOTE_GROUP syllables+=(ID|HYPHEN)+ END_NOTE_GROUP
;
/*
* Notes and keys
*/
//enum Mode:
// major='major' | minor='minor'
//;
Note:
ID DURATION?
;
/*
* Terminals
*/
terminal ID: '^'?('a'..'z'|'A'..'Z'|','|';'|'.'|':')*;
terminal DURATION: ('1'|'2'|'4'|'8'|'16'|'\breve')+;
terminal HYPHEN: '--';
terminal EXTENDER: '__';
terminal START_NOTE_GROUP: '<';
terminal END_NOTE_GROUP: '>';
terminal BEGIN: 'synthetic:BEGIN';
terminal END: 'synthetic:END';
terminal ML_COMMENT : '/*' -> '*/';
terminal SL_COMMENT : '//' !('\n'|'\r')* ('\r'? '\n')?;
terminal WS : (' '|'\t'|'\r'|'\n')+;
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04702 seconds