gisele 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. data/CHANGELOG.md +30 -15
  2. data/Gemfile +1 -0
  3. data/Gemfile.lock +2 -0
  4. data/gisele.gemspec +1 -0
  5. data/gisele.noespec +2 -1
  6. data/lib/gisele/language/ast/node.rb +5 -0
  7. data/lib/gisele/language/{syntax/grammar.citrus → grammar.citrus} +0 -0
  8. data/lib/gisele/language/{dot.yml → grammar.dot.yml} +0 -0
  9. data/lib/gisele/language/grammar.sexp.yml +80 -0
  10. data/lib/gisele/language/{elsif_flattener.rb → processors/elsif_flattener.rb} +0 -0
  11. data/lib/gisele/language/{if_to_case.rb → processors/if_to_case.rb} +0 -0
  12. data/lib/gisele/language/{sugar_removal.rb → processors/sugar_removal.rb} +0 -0
  13. data/lib/gisele/language/{to_graph.rb → processors/to_graph.rb} +0 -0
  14. data/lib/gisele/language/processors.rb +4 -0
  15. data/lib/gisele/language/syntax/fluent_def.rb +1 -1
  16. data/lib/gisele/language/syntax/task_def.rb +1 -1
  17. data/lib/gisele/language/syntax/trackvar_def.rb +1 -1
  18. data/lib/gisele/language/syntax.rb +1 -1
  19. data/lib/gisele/language.rb +3 -5
  20. data/lib/gisele/loader.rb +1 -0
  21. data/lib/gisele/version.rb +1 -1
  22. data/spec/command/main/gisele_ast_ruby.stdout +1 -1
  23. data/spec/command/main/gisele_no_sugar.stdout +2 -2
  24. data/spec/command/main/gisele_version.stdout +1 -1
  25. data/spec/fixtures/tasks/simple.ast +1 -1
  26. data/spec/spec_helper.rb +9 -1
  27. data/spec/test_examples.rb +9 -1
  28. data/spec/unit/language/grammar_sexp/test_case_st.rb +20 -0
  29. data/spec/unit/language/grammar_sexp/test_event_set.rb +14 -0
  30. data/spec/unit/language/grammar_sexp/test_fluent_def.rb +18 -0
  31. data/spec/unit/language/grammar_sexp/test_initially.rb +18 -0
  32. data/spec/unit/language/grammar_sexp/test_nop_st.rb +10 -0
  33. data/spec/unit/language/grammar_sexp/test_when_clause.rb +12 -0
  34. data/spec/unit/language/{test_elsif_flattener.rb → processors/test_elsif_flattener.rb} +5 -1
  35. data/spec/unit/language/{test_if_to_case.rb → processors/test_if_to_case.rb} +5 -7
  36. data/spec/unit/language/{test_to_graph.rb → processors/test_to_graph.rb} +0 -0
  37. data/spec/unit/language/syntax/to_ast/test_fluent_def.rb +2 -2
  38. data/spec/unit/language/syntax/to_ast/test_task_def.rb +6 -6
  39. data/spec/unit/language/syntax/to_ast/test_trackvar_def.rb +2 -2
  40. data/spec/unit/language/syntax/to_ast/test_unit_def.rb +3 -3
  41. metadata +57 -32
data/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ # 0.4.0 / 2012-02-20
2
+
3
+ * Major enhancement
4
+
5
+ * The grammar is going to be stable very soon now (expect backward compatible additions,
6
+ maybe). As an helper to work with the grammar, a YAML file describing the structure of
7
+ the AST can be found in lib/gisele/language/grammar.sexp.yml
8
+
9
+ * Breaking changes
10
+
11
+ * The :nop statement has been renamed :nop_st.
12
+ * The kind of the AST nodes for fluent and tracking variable definitions have been renamed
13
+ :fluent_def and :trackvar_def. This is actually a bugfix but that might break other code
14
+ relying on 0.3.0.
15
+
1
16
  # 0.3.0 / 2012-02-20
2
17
 
3
18
  * Major enhancements
@@ -24,7 +39,7 @@
24
39
  task_refinement and task_signature have been removed as well. The AST signature of a task
25
40
  definition is now as follows:
26
41
 
27
- [:task_def, "TaskName", (fluent_def, trackvar_def, task_def)*, explicit_statement]
42
+ [:task_def, "TaskName", (fluent_def, trackvar_def, task_def)*, explicit_statement]
28
43
 
29
44
  # 0.2.0 / 2012-02-17
30
45
 
@@ -65,20 +80,20 @@
65
80
 
66
81
  * The following syntax nodes have been renamed:
67
82
 
68
- :varref -> :var_ref
69
- :or -> :bool_or
70
- :and -> :bool_and
71
- :not -> :bool_not
72
- :if -> :if_st
73
- :else -> :else_clause
74
- :elsif -> :elsif_clause
75
- :while -> :while_st
76
- :seq -> :seq_st
77
- :par -> :par_st
78
- :task_call -> :task_call_st
79
- :task -> :task_def
80
- :signature -> :task_signature
81
- :refinement -> :task_refinement
83
+ :varref -> :var_ref
84
+ :or -> :bool_or
85
+ :and -> :bool_and
86
+ :not -> :bool_not
87
+ :if -> :if_st
88
+ :else -> :else_clause
89
+ :elsif -> :elsif_clause
90
+ :while -> :while_st
91
+ :seq -> :seq_st
92
+ :par -> :par_st
93
+ :task_call -> :task_call_st
94
+ :task -> :task_def
95
+ :signature -> :task_signature
96
+ :refinement -> :task_refinement
82
97
 
83
98
  # 0.0.1 / 2012-02-16
84
99
 
data/Gemfile CHANGED
@@ -6,6 +6,7 @@ group :runtime do
6
6
  gem "quickl", "~> 0.4.3"
7
7
  gem "awesome_print", "~> 1.0"
8
8
  gem "yargi", "~> 0.2.0"
9
+ gem "sexp_grammar", "~> 0.1.0"
9
10
  end
10
11
 
11
12
  group :development do
data/Gemfile.lock CHANGED
@@ -15,6 +15,7 @@ GEM
15
15
  rspec-expectations (2.8.0)
16
16
  diff-lcs (~> 1.1.2)
17
17
  rspec-mocks (2.8.0)
18
+ sexp_grammar (0.1.0)
18
19
  wlang (0.10.2)
19
20
  yargi (0.2.0)
20
21
 
@@ -30,5 +31,6 @@ DEPENDENCIES
30
31
  quickl (~> 0.4.3)
31
32
  rake (~> 0.9.2)
32
33
  rspec (~> 2.8.0)
34
+ sexp_grammar (~> 0.1.0)
33
35
  wlang (~> 0.10.2)
34
36
  yargi (~> 0.2.0)
data/gisele.gemspec CHANGED
@@ -132,6 +132,7 @@ Gem::Specification.new do |s|
132
132
  s.add_dependency("quickl", "~> 0.4.3")
133
133
  s.add_dependency("awesome_print", "~> 1.0")
134
134
  s.add_dependency("yargi", "~> 0.2.0")
135
+ s.add_dependency("sexp_grammar", "~> 0.1.0")
135
136
 
136
137
  # The version of ruby required by this gem
137
138
  #
data/gisele.noespec CHANGED
@@ -12,7 +12,7 @@ variables:
12
12
  upper:
13
13
  Gisele
14
14
  version:
15
- 0.3.0
15
+ 0.4.0
16
16
  summary: |-
17
17
  Gisele is a Process Analyzer Toolset
18
18
  description: |-
@@ -30,6 +30,7 @@ variables:
30
30
  - {name: quickl, version: "~> 0.4.3", groups: [runtime]}
31
31
  - {name: awesome_print, version: "~> 1.0", groups: [runtime]}
32
32
  - {name: yargi, version: "~> 0.2.0", groups: [runtime]}
33
+ - {name: sexp_grammar, version: "~> 0.1.0", groups: [runtime]}
33
34
  #
34
35
  - {name: rake, version: "~> 0.9.2", groups: [development]}
35
36
  - {name: bundler, version: "~> 1.0", groups: [development]}
@@ -73,6 +73,11 @@ module Gisele
73
73
  attrs.merge(:label => label)
74
74
  end
75
75
 
76
+ # Checks validity over the definition
77
+ def ===(sexp)
78
+ SEXP_GRAMMAR[rule_name] === sexp
79
+ end
80
+
76
81
  end # module Node
77
82
  end # module AST
78
83
  end # module Language
File without changes
@@ -0,0 +1,80 @@
1
+ ### units and tasks
2
+ unit_def:
3
+ - [task_def+]
4
+ task_def:
5
+ - [task_name, some_def*, statement]
6
+ some_def:
7
+ - fluent_def
8
+ - trackvar_def
9
+ - task_def
10
+ ### variables
11
+ fluent_def:
12
+ - [var_name, event_set, event_set, initially]
13
+ trackvar_def:
14
+ - [var_name, event_set, event_set, initially]
15
+ event_set:
16
+ - [event*]
17
+ event:
18
+ - event_name
19
+ - task_event_name
20
+ var_ref:
21
+ - [var_name]
22
+ ### statements
23
+ statement:
24
+ - if_st
25
+ - case_st
26
+ - while_st
27
+ - seq_st
28
+ - par_st
29
+ - task_call_st
30
+ - nop_st
31
+ if_st:
32
+ - [bool_expr, statement, elsif_clause*, "else_clause?"]
33
+ case_st:
34
+ - [[var_ref, ~], when_clause+, "else_clause?"]
35
+ while_st:
36
+ - [bool_expr, statement]
37
+ seq_st:
38
+ - [statement+]
39
+ par_st:
40
+ - [statement+]
41
+ task_call_st:
42
+ - [task_name]
43
+ nop_st:
44
+ - []
45
+ ### clauses
46
+ elsif_clause:
47
+ - [bool_expr, statement]
48
+ else_clause:
49
+ - [statement]
50
+ when_clause:
51
+ - [bool_expr, statement]
52
+ ### boolean expressions
53
+ bool_expr:
54
+ - [bool_expression]
55
+ bool_expression:
56
+ - bool_or
57
+ - bool_and
58
+ - bool_not
59
+ - var_ref
60
+ - bool_lit
61
+ bool_or:
62
+ - [bool_expression, bool_expression]
63
+ bool_and:
64
+ - [bool_expression, bool_expression]
65
+ bool_not:
66
+ - [bool_expression]
67
+ bool_lit:
68
+ - [ boolean_literal ]
69
+ boolean_literal:
70
+ - true
71
+ - false
72
+ ### terminals
73
+ task_name: !ruby/regexp /^[A-Z][A-Za-z0-9_]*$/
74
+ var_name: !ruby/regexp /^[a-z][A-Za-z0-9_]*$/
75
+ event_name: !ruby/regexp /^[a-z][a-z0-9_]*$/
76
+ task_event_name: !ruby/regexp /^[A-Z][A-Za-z0-9_]*:(start|end)$/
77
+ initially:
78
+ - true
79
+ - false
80
+ - ~
@@ -0,0 +1,4 @@
1
+ require_relative 'processors/elsif_flattener'
2
+ require_relative 'processors/if_to_case'
3
+ require_relative 'processors/sugar_removal'
4
+ require_relative 'processors/to_graph'
@@ -9,7 +9,7 @@ module Gisele
9
9
  init, term = captures[:event_set].map{|x| x.to_ast}
10
10
  initval = captures[:initially_def].first
11
11
  initval = (initval && !initval.empty?) ? initval.value : nil
12
- [:fluent, name, init, term, initval]
12
+ [:fluent_def, name, init, term, initval]
13
13
  end
14
14
 
15
15
  end # module FluentDef
@@ -8,7 +8,7 @@ module Gisele
8
8
  name = captures[:task_name].first.strip
9
9
  defs = captures[:some_def].map{|x| x.to_ast}
10
10
  ref = captures[:explicit_statement].map{|x| x.to_ast}.first
11
- ref = [:nop] unless ref
11
+ ref = [:nop_st] unless ref
12
12
  [:task_def, name] + defs + [ref]
13
13
  end
14
14
 
@@ -10,7 +10,7 @@ module Gisele
10
10
  term = [:event_set] unless term
11
11
  initval = captures[:initially_def].first
12
12
  initval = (initval && !initval.empty?) ? initval.value : nil
13
- [:trackvar, name, init, term, initval]
13
+ [:trackvar_def, name, init, term, initval]
14
14
  end
15
15
 
16
16
  end # module TrackvarDef
@@ -2,7 +2,7 @@ require_relative 'syntax/node'
2
2
  module Gisele
3
3
  module Language
4
4
  module Syntax
5
- Citrus.load(File.expand_path('../syntax/grammar', __FILE__))
5
+ Citrus.load(File.expand_path('../grammar', __FILE__))
6
6
 
7
7
  def parse(input, options = {})
8
8
  source = parsing_source(input)
@@ -2,7 +2,8 @@ module Gisele
2
2
  module Language
3
3
 
4
4
  require 'yaml'
5
- DOT_ATTRIBUTES = YAML.load_file(Path.dir/"language/dot.yml")
5
+ DOT_ATTRIBUTES = YAML.load_file(Path.dir/"language/grammar.dot.yml")
6
+ SEXP_GRAMMAR = SexpGrammar.load Path.dir/"language/grammar.sexp.yml"
6
7
 
7
8
  RESERVED_WORDS = [
8
9
  "if",
@@ -41,7 +42,4 @@ end # module Gisele
41
42
  require_relative 'language/syntax'
42
43
  require_relative 'language/ast'
43
44
  require_relative 'language/rewriter'
44
- require_relative 'language/elsif_flattener'
45
- require_relative 'language/if_to_case'
46
- require_relative 'language/sugar_removal'
47
- require_relative 'language/to_graph'
45
+ require_relative 'language/processors'
data/lib/gisele/loader.rb CHANGED
@@ -3,3 +3,4 @@ require "epath"
3
3
  require "quickl"
4
4
  require "awesome_print"
5
5
  require "yargi"
6
+ require "sexp_grammar"
@@ -2,7 +2,7 @@ module Gisele
2
2
  module Version
3
3
 
4
4
  MAJOR = 0
5
- MINOR = 3
5
+ MINOR = 4
6
6
  TINY = 0
7
7
 
8
8
  def self.to_s
@@ -4,7 +4,7 @@
4
4
  :task_def,
5
5
  "Simple",
6
6
  [
7
- :fluent,
7
+ :fluent_def,
8
8
  "diagKnown",
9
9
  [
10
10
  :event_set,
@@ -4,7 +4,7 @@
4
4
  :task_def,
5
5
  "Complete",
6
6
  [
7
- :trackvar,
7
+ :trackvar_def,
8
8
  "everyOneHappy",
9
9
  [
10
10
  :event_set,
@@ -16,7 +16,7 @@
16
16
  nil
17
17
  ],
18
18
  [
19
- :fluent,
19
+ :fluent_def,
20
20
  "someoneHappy",
21
21
  [
22
22
  :event_set,
@@ -1,2 +1,2 @@
1
- gisele 0.3.0 (c) The University of Louvain
1
+ gisele 0.4.0 (c) The University of Louvain
2
2
  SystemExit
@@ -4,7 +4,7 @@
4
4
  :task_def,
5
5
  "Simple",
6
6
  [
7
- :fluent,
7
+ :fluent_def,
8
8
  "diagKnown",
9
9
  [
10
10
  :event_set,
data/spec/spec_helper.rb CHANGED
@@ -20,7 +20,11 @@ module SpecHelpers
20
20
  end
21
21
 
22
22
  def ast(text, rule, consume = true)
23
- parse(text, rule, consume).to_ast
23
+ ast = parse(text, rule, consume).to_ast
24
+ unless sexp_grammar[rule] === ast
25
+ raise "expected #{ast} to match #{rule} (#{text})"
26
+ end
27
+ ast
24
28
  end
25
29
 
26
30
  def fixtures_dir
@@ -31,6 +35,10 @@ module SpecHelpers
31
35
  fixtures_dir.glob(glob)
32
36
  end
33
37
 
38
+ def sexp_grammar
39
+ Gisele::Language::SEXP_GRAMMAR
40
+ end
41
+
34
42
  def simple_ast
35
43
  Gisele::ast(fixtures_dir/:tasks/"simple.gis")
36
44
  end
@@ -4,9 +4,17 @@ describe "The examples" do
4
4
  (Path.backfind(".[examples]")/:examples).glob("**/*.gis").each do |file|
5
5
 
6
6
  describe file do
7
+
8
+ let(:ast){ Gisele::ast(file) }
9
+
7
10
  it 'parses without any error' do
8
- Gisele::ast(file).should be_a(Array)
11
+ ast.should be_a(Array)
9
12
  end
13
+
14
+ it 'respects the SexpGrammar' do
15
+ (Gisele::Language::SEXP_GRAMMAR === ast).should be_true
16
+ end
17
+
10
18
  end
11
19
 
12
20
  end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+ module Gisele::Language
3
+ describe "the Sexp grammar", "case_st" do
4
+
5
+ it 'matches when no variable is specified' do
6
+ case_st = \
7
+ [:case_st, nil,
8
+ [:when_clause, [:bool_expr, [:bool_lit, true]], [:nop_st]] ]
9
+ (sexp_grammar[:case_st] === case_st).should be_true
10
+ end
11
+
12
+ it 'matches when a variable is specified' do
13
+ case_st = \
14
+ [:case_st, [:var_ref, "varName"],
15
+ [:when_clause, [:bool_expr, [:bool_lit, true]], [:nop_st]] ]
16
+ (sexp_grammar[:case_st] === case_st).should be_true
17
+ end
18
+
19
+ end
20
+ end
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+ module Gisele::Language
3
+ describe "the Sexp grammar", "event_set" do
4
+
5
+ it 'matches an empty set' do
6
+ (sexp_grammar[:event_set] === [:event_set]).should be_true
7
+ end
8
+
9
+ it 'matches a non empty set' do
10
+ (sexp_grammar[:event_set] === [:event_set, "event", "Task:start"]).should be_true
11
+ end
12
+
13
+ end
14
+ end
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+ module Gisele::Language
3
+ describe "the Sexp grammar", "fluent_def" do
4
+
5
+ let(:g){ SEXP_GRAMMAR }
6
+
7
+ it 'matches an fluent with initial value' do
8
+ fluent = [:fluent_def, "name", [:event_set, "start"], [:event_set, "stop"], true]
9
+ (sexp_grammar[:fluent_def] === fluent).should be_true
10
+ end
11
+
12
+ it 'matches an fluent without initial value' do
13
+ fluent = [:fluent_def, "name", [:event_set, "start"], [:event_set, "stop"], nil]
14
+ (sexp_grammar[:fluent_def] === fluent).should be_true
15
+ end
16
+
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+ module Gisele::Language
3
+ describe "the Sexp grammar", "initially" do
4
+
5
+ it 'matches true' do
6
+ (sexp_grammar[:initially] === true).should be_true
7
+ end
8
+
9
+ it 'matches false' do
10
+ (sexp_grammar[:initially] === false).should be_true
11
+ end
12
+
13
+ it 'matches nil' do
14
+ (sexp_grammar[:initially] === nil).should be_true
15
+ end
16
+
17
+ end
18
+ end
@@ -0,0 +1,10 @@
1
+ require 'spec_helper'
2
+ module Gisele::Language
3
+ describe "the Sexp grammar", "nop_st" do
4
+
5
+ it 'matches [:nop_st]' do
6
+ (sexp_grammar[:nop_st] === [:nop_st]).should be_true
7
+ end
8
+
9
+ end
10
+ end
@@ -0,0 +1,12 @@
1
+ require 'spec_helper'
2
+ module Gisele::Language
3
+ describe "the Sexp grammar", "when_clause" do
4
+
5
+ it 'matches a valid when clause' do
6
+ when_clause = \
7
+ [:when_clause, [:bool_expr, [:bool_lit, true]], [:nop_st]]
8
+ (sexp_grammar[:when_clause] === when_clause).should be_true
9
+ end
10
+
11
+ end
12
+ end
@@ -7,9 +7,13 @@ module Gisele::Language
7
7
  end
8
8
 
9
9
  def rewrite(ast)
10
- ElsifFlattener.new.call(ast)
10
+ @rewrited = ElsifFlattener.new.call(ast)
11
11
  end
12
12
 
13
+ after{
14
+ (sexp_grammar[:if_st] === @rewrited).should be_true
15
+ }
16
+
13
17
  it 'rewrites a single if correctly' do
14
18
  source = ast("if goodCond Task1 end")
15
19
  rewrite(source).should eq(source)
@@ -7,9 +7,13 @@ module Gisele::Language
7
7
  end
8
8
 
9
9
  def rewrite(ast)
10
- IfToCase.new.call(ast)
10
+ @rewrited = IfToCase.new.call(ast)
11
11
  end
12
12
 
13
+ after{
14
+ (sexp_grammar[:case_st] === @rewrited).should be_true
15
+ }
16
+
13
17
  it 'rewrites single if correctly' do
14
18
  source = ast("if goodCond Task1 end")
15
19
  expected = \
@@ -83,12 +87,6 @@ module Gisele::Language
83
87
  rewrite(source).should eq(expected)
84
88
  end
85
89
 
86
- it 'recurse on other nodes' do
87
- if_st = ast("if goodCond Task1 end")
88
- rw_st = rewrite(if_st)
89
- rewrite([:unit, if_st]).should eq([:unit, rw_st])
90
- end
91
-
92
90
  it 'keeps traceability markers on a single if' do
93
91
  if_st = ast("if goodCond Task1 end")
94
92
  rw_st = rewrite(if_st)
@@ -4,7 +4,7 @@ module Gisele::Language::Syntax
4
4
 
5
5
  it 'converts fluent definitions as expected' do
6
6
  defn = "fluent diagKnown {Diagnosis:start, diagnosis}, {Treatment:end} initially false"
7
- expected = [:fluent,
7
+ expected = [:fluent_def,
8
8
  "diagKnown",
9
9
  [:event_set, "Diagnosis:start", "diagnosis"],
10
10
  [:event_set, "Treatment:end"],
@@ -14,7 +14,7 @@ module Gisele::Language::Syntax
14
14
 
15
15
  it 'does not require the initial value' do
16
16
  defn = "fluent diagKnown {Diagnosis:start, diagnosis}, {Treatment:end}"
17
- expected = [:fluent,
17
+ expected = [:fluent_def,
18
18
  "diagKnown",
19
19
  [:event_set, "Diagnosis:start", "diagnosis"],
20
20
  [:event_set, "Treatment:end"],
@@ -11,12 +11,12 @@ module Gisele::Language::Syntax
11
11
  EXPR
12
12
  expected = \
13
13
  [:task_def, "Task1",
14
- [:fluent, "diagKnown", [:event_set], [:event_set], nil],
14
+ [:fluent_def, "diagKnown", [:event_set], [:event_set], nil],
15
15
  [:task_call_st, "Task2"]]
16
16
  ast(expr, :task_def).should eq(expected)
17
17
  end
18
18
 
19
- it 'uses :nop if no statement' do
19
+ it 'uses :nop_st if no statement' do
20
20
  expr = <<-EXPR.strip
21
21
  task Task1
22
22
  fluent diagKnown {}, {}
@@ -24,19 +24,19 @@ module Gisele::Language::Syntax
24
24
  EXPR
25
25
  expected = \
26
26
  [:task_def, "Task1",
27
- [:fluent, "diagKnown", [:event_set], [:event_set], nil],
28
- [:nop]]
27
+ [:fluent_def, "diagKnown", [:event_set], [:event_set], nil],
28
+ [:nop_st]]
29
29
  ast(expr, :task_def).should eq(expected)
30
30
  end
31
31
 
32
- it 'uses :nop when empty' do
32
+ it 'uses :nop_st when empty' do
33
33
  expr = <<-EXPR.strip
34
34
  task Task1
35
35
  end
36
36
  EXPR
37
37
  expected = \
38
38
  [:task_def, "Task1",
39
- [:nop]]
39
+ [:nop_st]]
40
40
  ast(expr, :task_def).should eq(expected)
41
41
  end
42
42
 
@@ -4,7 +4,7 @@ module Gisele::Language::Syntax
4
4
 
5
5
  it 'converts tracking variable definitions as expected' do
6
6
  defn = "trackvar mplus {Diagnosis:start}"
7
- expected = [:trackvar,
7
+ expected = [:trackvar_def,
8
8
  "mplus",
9
9
  [:event_set, "Diagnosis:start"],
10
10
  [:event_set],
@@ -14,7 +14,7 @@ module Gisele::Language::Syntax
14
14
 
15
15
  it 'supports obsolete events and initial value' do
16
16
  defn = "trackvar mplus {Diagnosis:start}, {Treatment:end} initially true"
17
- expected = [:trackvar,
17
+ expected = [:trackvar_def,
18
18
  "mplus",
19
19
  [:event_set, "Diagnosis:start"],
20
20
  [:event_set, "Treatment:end"],
@@ -8,7 +8,7 @@ module Gisele::Language::Syntax
8
8
  UNIT
9
9
  expected = \
10
10
  [:unit_def,
11
- [:task_def, "Task1", [:nop]]]
11
+ [:task_def, "Task1", [:nop_st]]]
12
12
  ast(expr, :unit_def).should eq(expected)
13
13
  end
14
14
 
@@ -19,8 +19,8 @@ module Gisele::Language::Syntax
19
19
  UNIT
20
20
  expected = \
21
21
  [:unit_def,
22
- [:task_def, "Task1", [:nop]],
23
- [:task_def, "Task2", [:nop]] ]
22
+ [:task_def, "Task1", [:nop_st]],
23
+ [:task_def, "Task2", [:nop_st]] ]
24
24
  ast(expr, :unit_def).should eq(expected)
25
25
  end
26
26
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gisele
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70110318039380 !ruby/object:Gem::Requirement
16
+ requirement: &70178529922440 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.9.2
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70110318039380
24
+ version_requirements: *70178529922440
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bundler
27
- requirement: &70110318038460 !ruby/object:Gem::Requirement
27
+ requirement: &70178529919520 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '1.0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70110318038460
35
+ version_requirements: *70178529919520
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70110318036100 !ruby/object:Gem::Requirement
38
+ requirement: &70178529917540 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.8.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70110318036100
46
+ version_requirements: *70178529917540
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: wlang
49
- requirement: &70110318051380 !ruby/object:Gem::Requirement
49
+ requirement: &70178529916080 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.10.2
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70110318051380
57
+ version_requirements: *70178529916080
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: citrus
60
- requirement: &70110318050820 !ruby/object:Gem::Requirement
60
+ requirement: &70178529931480 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '2.4'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70110318050820
68
+ version_requirements: *70178529931480
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: epath
71
- requirement: &70110318050260 !ruby/object:Gem::Requirement
71
+ requirement: &70178529930900 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 0.0.1
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70110318050260
79
+ version_requirements: *70178529930900
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: quickl
82
- requirement: &70110318049560 !ruby/object:Gem::Requirement
82
+ requirement: &70178529930360 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 0.4.3
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *70110318049560
90
+ version_requirements: *70178529930360
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: awesome_print
93
- requirement: &70110318048900 !ruby/object:Gem::Requirement
93
+ requirement: &70178529929540 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '1.0'
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *70110318048900
101
+ version_requirements: *70178529929540
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: yargi
104
- requirement: &70110318048220 !ruby/object:Gem::Requirement
104
+ requirement: &70178529928700 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ~>
@@ -109,7 +109,18 @@ dependencies:
109
109
  version: 0.2.0
110
110
  type: :runtime
111
111
  prerelease: false
112
- version_requirements: *70110318048220
112
+ version_requirements: *70178529928700
113
+ - !ruby/object:Gem::Dependency
114
+ name: sexp_grammar
115
+ requirement: &70178529927800 !ruby/object:Gem::Requirement
116
+ none: false
117
+ requirements:
118
+ - - ~>
119
+ - !ruby/object:Gem::Version
120
+ version: 0.1.0
121
+ type: :runtime
122
+ prerelease: false
123
+ version_requirements: *70178529927800
113
124
  description: ! 'This is a fresh-new implementation of the process analysis techniques
114
125
 
115
126
  developed in the Gisele and PIPAS research projects at UCLouvain'
@@ -149,14 +160,18 @@ files:
149
160
  - lib/gisele/language/ast/when_clause.rb
150
161
  - lib/gisele/language/ast/while_st.rb
151
162
  - lib/gisele/language/ast.rb
152
- - lib/gisele/language/dot.yml
153
- - lib/gisele/language/elsif_flattener.rb
154
- - lib/gisele/language/if_to_case.rb
163
+ - lib/gisele/language/grammar.citrus
164
+ - lib/gisele/language/grammar.dot.yml
165
+ - lib/gisele/language/grammar.sexp.yml
166
+ - lib/gisele/language/processors/elsif_flattener.rb
167
+ - lib/gisele/language/processors/if_to_case.rb
168
+ - lib/gisele/language/processors/sugar_removal.rb
169
+ - lib/gisele/language/processors/to_graph.rb
170
+ - lib/gisele/language/processors.rb
155
171
  - lib/gisele/language/rewriter/helper.rb
156
172
  - lib/gisele/language/rewriter/scoping.rb
157
173
  - lib/gisele/language/rewriter/work_on_nodes.rb
158
174
  - lib/gisele/language/rewriter.rb
159
- - lib/gisele/language/sugar_removal.rb
160
175
  - lib/gisele/language/syntax/bool_and.rb
161
176
  - lib/gisele/language/syntax/bool_expr.rb
162
177
  - lib/gisele/language/syntax/bool_lit.rb
@@ -168,7 +183,6 @@ files:
168
183
  - lib/gisele/language/syntax/elsif_clause.rb
169
184
  - lib/gisele/language/syntax/event_set.rb
170
185
  - lib/gisele/language/syntax/fluent_def.rb
171
- - lib/gisele/language/syntax/grammar.citrus
172
186
  - lib/gisele/language/syntax/if_st.rb
173
187
  - lib/gisele/language/syntax/implicit_seq_st.rb
174
188
  - lib/gisele/language/syntax/node.rb
@@ -183,7 +197,6 @@ files:
183
197
  - lib/gisele/language/syntax/when_clause.rb
184
198
  - lib/gisele/language/syntax/while_st.rb
185
199
  - lib/gisele/language/syntax.rb
186
- - lib/gisele/language/to_graph.rb
187
200
  - lib/gisele/language.rb
188
201
  - lib/gisele/loader.rb
189
202
  - lib/gisele/version.rb
@@ -209,6 +222,15 @@ files:
209
222
  - spec/spec_helper.rb
210
223
  - spec/test_examples.rb
211
224
  - spec/unit/language/ast/test_node.rb
225
+ - spec/unit/language/grammar_sexp/test_case_st.rb
226
+ - spec/unit/language/grammar_sexp/test_event_set.rb
227
+ - spec/unit/language/grammar_sexp/test_fluent_def.rb
228
+ - spec/unit/language/grammar_sexp/test_initially.rb
229
+ - spec/unit/language/grammar_sexp/test_nop_st.rb
230
+ - spec/unit/language/grammar_sexp/test_when_clause.rb
231
+ - spec/unit/language/processors/test_elsif_flattener.rb
232
+ - spec/unit/language/processors/test_if_to_case.rb
233
+ - spec/unit/language/processors/test_to_graph.rb
212
234
  - spec/unit/language/rewriter/test_helper.rb
213
235
  - spec/unit/language/rewriter/test_scoping.rb
214
236
  - spec/unit/language/rewriter/test_work_on_nodes.rb
@@ -250,11 +272,8 @@ files:
250
272
  - spec/unit/language/syntax/to_ast/test_when_clause.rb
251
273
  - spec/unit/language/syntax/to_ast/test_while_st.rb
252
274
  - spec/unit/language/test_ast.rb
253
- - spec/unit/language/test_elsif_flattener.rb
254
- - spec/unit/language/test_if_to_case.rb
255
275
  - spec/unit/language/test_rewriter.rb
256
276
  - spec/unit/language/test_syntax.rb
257
- - spec/unit/language/test_to_graph.rb
258
277
  - spec/unit/test_gisele.rb
259
278
  - spec/unit/test_language.rb
260
279
  - tasks/debug_mail.rake
@@ -277,7 +296,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
277
296
  version: '0'
278
297
  segments:
279
298
  - 0
280
- hash: -1270039991720770825
299
+ hash: 1798935773122407326
281
300
  required_rubygems_version: !ruby/object:Gem::Requirement
282
301
  none: false
283
302
  requirements:
@@ -308,6 +327,15 @@ test_files:
308
327
  - spec/spec_helper.rb
309
328
  - spec/test_examples.rb
310
329
  - spec/unit/language/ast/test_node.rb
330
+ - spec/unit/language/grammar_sexp/test_case_st.rb
331
+ - spec/unit/language/grammar_sexp/test_event_set.rb
332
+ - spec/unit/language/grammar_sexp/test_fluent_def.rb
333
+ - spec/unit/language/grammar_sexp/test_initially.rb
334
+ - spec/unit/language/grammar_sexp/test_nop_st.rb
335
+ - spec/unit/language/grammar_sexp/test_when_clause.rb
336
+ - spec/unit/language/processors/test_elsif_flattener.rb
337
+ - spec/unit/language/processors/test_if_to_case.rb
338
+ - spec/unit/language/processors/test_to_graph.rb
311
339
  - spec/unit/language/rewriter/test_helper.rb
312
340
  - spec/unit/language/rewriter/test_scoping.rb
313
341
  - spec/unit/language/rewriter/test_work_on_nodes.rb
@@ -349,10 +377,7 @@ test_files:
349
377
  - spec/unit/language/syntax/to_ast/test_when_clause.rb
350
378
  - spec/unit/language/syntax/to_ast/test_while_st.rb
351
379
  - spec/unit/language/test_ast.rb
352
- - spec/unit/language/test_elsif_flattener.rb
353
- - spec/unit/language/test_if_to_case.rb
354
380
  - spec/unit/language/test_rewriter.rb
355
381
  - spec/unit/language/test_syntax.rb
356
- - spec/unit/language/test_to_graph.rb
357
382
  - spec/unit/test_gisele.rb
358
383
  - spec/unit/test_language.rb