Skip to content

Commit

Permalink
Mudanças na gramática, geração de teste
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabioclug committed Oct 29, 2015
1 parent 6f33e87 commit 14f7cfb
Show file tree
Hide file tree
Showing 67 changed files with 7,168 additions and 5,588 deletions.
67 changes: 45 additions & 22 deletions ufscar.Compiladores2/bin/ufscar/compiladores2/Musy.xtext
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,61 @@ Midi:
MidiBody:
{MidiBody}
param += Parameter*
chords += DeclaredChord*
tracks += Track*
;

Parameter:
{Parameter}
('BPM' ':' beat = INT) type = "bpm" |
('TIME_SIGNATURE' ':' tsig = TimeSignature) type = "time_sig" |
('TIME_NOTE' ':' tn = Tn) type = "time_note" |
('TIME_PAUSE' ':' tp = Tp) type = "time_pause" |
('OCTAVE' ':' octave = INT) type = "octave"
ParameterBeat |
ParameterTimeSignature |
ParameterTimeNote |
ParameterTimePause |
ParameterOctave
;


ParameterBeat:
('BPM' ':' beat = INT)
;

ParameterTimeSignature:
('TIME_SIGNATURE' ':' tsig = TimeSignature)
;

ParameterTimeNote:
('TIME_NOTE' ':' tn = Tn)
;

ParameterTimePause:
('TIME_PAUSE' ':' tp = Tp)
;

ParameterOctave:
('OCTAVE' ':' octave = INT)
;

DeclaredChord:
'chord' '(' cp=ChordParams ')' name = ID
;

Track:
'TRACK' name = ID ':' Instrument '{'
'TRACK' name = ID ':' i=Instrument '{'
tbody = TrackBody
'}'
;

TrackBody:
body = BodyComponent (more = MoreTrackBody)?
bc += BodyComponent (',' bc += BodyComponent)*
;

MoreTrackBody:
{MoreTrackBody}
(',' morebody += BodyComponent)+
;
//MoreTrackBody:
// {MoreTrackBody}
// (',' morebody += BodyComponent)+
//;

BodyComponent:
cnote = CustomNote | note = Note | block = Block | chord = Chord
//cnote = CustomNote |
note = Note | block = Block | ch = [DeclaredChord]
;

Block:
Expand All @@ -60,16 +86,13 @@ Tn:
Tp
;

CustomNote:
Note '(' CustomNoteParam ')'
;
//CustomNote:
// Note '(' CustomNoteParam ')'
//;

Chord:
'chord' '(' ChordParams ')' name = ID
;

ChordParams:
(Note | CustomNote) (',' (Note | cnotes += CustomNote))*
(cnote+=Note) (',' cnote+=Note)*
;

NoteLetter:
Expand All @@ -81,13 +104,13 @@ Accident:
;

Note:
NoteLetter Accident?
nl=NoteLetter acc=Accident? ('(' cnp=CustomNoteParam ')')?
;

Instrument:
'PIANO' | 'GUITAR' | 'ELETRIC GUITAR' | 'BASS' | 'SAX' | 'VIOLIN' | 'DRUMS'
;

CustomNoteParam:
octave = INT ',' Tn | Tn ',' INT | INT | Tn
octave = INT ',' duration = Tn | duration = Tn ',' octave = INT | octave = INT | duration = Tn
;
Binary file modified ufscar.Compiladores2/bin/ufscar/compiladores2/Musy.xtextbin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 14f7cfb

Please sign in to comment.