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