Initial Revision
[ohcount] / ext / ohcount_native / glots / rhtml_polyglot.rb
1 require 'polyglot'
2
3 module Ohcount
4         class RhtmlPolyglot < Polyglot
5
6                 def initialize(name, html, ruby)
7                         @name = name
8
9                         @states = html.all_states + ruby.states
10                         @extra_states = []
11
12                         @transitions = html.all_transitions + ruby.transitions
13                         @extra_transitions = []
14
15                         # stitch phplanguage
16                         @extra_transitions << StitchTransition.new("<%", :html_markup, :ruby_code, :from, false, name)
17                         @extra_transitions << StitchTransition.new("<%", :html_comment, :ruby_code, :from, false, name)
18                         @extra_transitions << StitchTransition.new("<%", :html_squote, :ruby_code, :from, false, name)
19                         @extra_transitions << StitchTransition.new("<%", :html_dquote, :ruby_code, :from, false, name)
20                         @extra_transitions << StitchTransition.new("%>", :ruby_code, :return, :to, false, name)
21                 end
22         end
23 end