Author: kkaempf
Date: Mon Jul 16 12:46:10 2007
New Revision: 39421
URL: http://svn.opensuse.org/viewcvs/yast?rev=39421&view=rev
Log:
Initial import of XML->Ruby converter
Added:
trunk/yxmlconv/
trunk/yxmlconv/README
trunk/yxmlconv/src/
trunk/yxmlconv/src/block.rb
trunk/yxmlconv/src/convert.rb
trunk/yxmlconv/src/expressions.rb
trunk/yxmlconv/src/helper.rb
trunk/yxmlconv/src/listener.rb
trunk/yxmlconv/src/output.rb
trunk/yxmlconv/src/statements.rb
trunk/yxmlconv/src/symbols.rb
trunk/yxmlconv/tests/
trunk/yxmlconv/tests/Makefile
trunk/yxmlconv/tests/boolean.rb
trunk/yxmlconv/tests/bracket_assign.rb
trunk/yxmlconv/tests/builtin_boolean.rb
trunk/yxmlconv/tests/builtin_float.rb
trunk/yxmlconv/tests/builtin_integer.rb
trunk/yxmlconv/tests/builtin_string.rb
trunk/yxmlconv/tests/check_clients.sh
trunk/yxmlconv/tests/compare.rb
trunk/yxmlconv/tests/converter_test.rb
trunk/yxmlconv/tests/create_clients.sh
trunk/yxmlconv/tests/do.rb
trunk/yxmlconv/tests/float.rb
trunk/yxmlconv/tests/if.rb
trunk/yxmlconv/tests/integer.rb
trunk/yxmlconv/tests/list.rb
trunk/yxmlconv/tests/locale.rb
trunk/yxmlconv/tests/map.rb
trunk/yxmlconv/tests/path.rb
trunk/yxmlconv/tests/repeat.rb
trunk/yxmlconv/tests/string.rb
trunk/yxmlconv/tests/symbol.rb
trunk/yxmlconv/tests/term.rb
trunk/yxmlconv/tests/triple.rb
trunk/yxmlconv/tests/variable.rb
trunk/yxmlconv/tests/void.rb
trunk/yxmlconv/tests/while.rb
trunk/yxmlconv/tests/xml/
trunk/yxmlconv/tests/xml/boolean.xml
trunk/yxmlconv/tests/xml/boolean.ycp
trunk/yxmlconv/tests/xml/bracket_assign.xml
trunk/yxmlconv/tests/xml/bracket_assign.ycp
trunk/yxmlconv/tests/xml/builtin_boolean.xml
trunk/yxmlconv/tests/xml/builtin_boolean.ycp
trunk/yxmlconv/tests/xml/builtin_float.xml
trunk/yxmlconv/tests/xml/builtin_float.ycp
trunk/yxmlconv/tests/xml/builtin_float1.xml
trunk/yxmlconv/tests/xml/builtin_float1.ycp
trunk/yxmlconv/tests/xml/builtin_integer.xml
trunk/yxmlconv/tests/xml/builtin_integer.ycp
trunk/yxmlconv/tests/xml/builtin_string.xml
trunk/yxmlconv/tests/xml/builtin_string.ycp
trunk/yxmlconv/tests/xml/compare.xml
trunk/yxmlconv/tests/xml/compare.ycp
trunk/yxmlconv/tests/xml/do.xml
trunk/yxmlconv/tests/xml/do.ycp
trunk/yxmlconv/tests/xml/float.xml
trunk/yxmlconv/tests/xml/float.ycp
trunk/yxmlconv/tests/xml/if.xml
trunk/yxmlconv/tests/xml/if.ycp
trunk/yxmlconv/tests/xml/if1.xml
trunk/yxmlconv/tests/xml/if1.ycp
trunk/yxmlconv/tests/xml/if2.xml
trunk/yxmlconv/tests/xml/if2.ycp
trunk/yxmlconv/tests/xml/if3.xml
trunk/yxmlconv/tests/xml/if3.ycp
trunk/yxmlconv/tests/xml/integer.xml
trunk/yxmlconv/tests/xml/integer.ycp
trunk/yxmlconv/tests/xml/list.xml
trunk/yxmlconv/tests/xml/list.ycp
trunk/yxmlconv/tests/xml/list1.xml
trunk/yxmlconv/tests/xml/list1.ycp
trunk/yxmlconv/tests/xml/list2.xml
trunk/yxmlconv/tests/xml/list2.ycp
trunk/yxmlconv/tests/xml/list3.xml
trunk/yxmlconv/tests/xml/list3.ycp
trunk/yxmlconv/tests/xml/list4.xml
trunk/yxmlconv/tests/xml/list4.ycp
trunk/yxmlconv/tests/xml/listlist.xml
trunk/yxmlconv/tests/xml/listlist.ycp
trunk/yxmlconv/tests/xml/listmap.xml
trunk/yxmlconv/tests/xml/listmap.ycp
trunk/yxmlconv/tests/xml/locale.xml
trunk/yxmlconv/tests/xml/locale.ycp
trunk/yxmlconv/tests/xml/locale1.xml
trunk/yxmlconv/tests/xml/locale1.ycp
trunk/yxmlconv/tests/xml/map.xml
trunk/yxmlconv/tests/xml/map.ycp
trunk/yxmlconv/tests/xml/map1.xml
trunk/yxmlconv/tests/xml/map1.ycp
trunk/yxmlconv/tests/xml/map2.xml
trunk/yxmlconv/tests/xml/map2.ycp
trunk/yxmlconv/tests/xml/map3.xml
trunk/yxmlconv/tests/xml/map3.ycp
trunk/yxmlconv/tests/xml/map4.xml
trunk/yxmlconv/tests/xml/map4.ycp
trunk/yxmlconv/tests/xml/maplist.xml
trunk/yxmlconv/tests/xml/maplist.ycp
trunk/yxmlconv/tests/xml/mapmap.xml
trunk/yxmlconv/tests/xml/mapmap.ycp
trunk/yxmlconv/tests/xml/path.xml
trunk/yxmlconv/tests/xml/path.ycp
trunk/yxmlconv/tests/xml/repeat.xml
trunk/yxmlconv/tests/xml/repeat.ycp
trunk/yxmlconv/tests/xml/run (with props)
trunk/yxmlconv/tests/xml/string.xml
trunk/yxmlconv/tests/xml/string.ycp
trunk/yxmlconv/tests/xml/symbol.xml
trunk/yxmlconv/tests/xml/symbol.ycp
trunk/yxmlconv/tests/xml/term.xml
trunk/yxmlconv/tests/xml/term.ycp
trunk/yxmlconv/tests/xml/term1.xml
trunk/yxmlconv/tests/xml/term1.ycp
trunk/yxmlconv/tests/xml/triple.xml
trunk/yxmlconv/tests/xml/triple.ycp
trunk/yxmlconv/tests/xml/variable.xml
trunk/yxmlconv/tests/xml/variable.ycp
trunk/yxmlconv/tests/xml/void.xml
trunk/yxmlconv/tests/xml/void.ycp
trunk/yxmlconv/tests/xml/void1.xml
trunk/yxmlconv/tests/xml/void1.ycp
trunk/yxmlconv/tests/xml/while.xml
trunk/yxmlconv/tests/xml/while.ycp
trunk/yxmlconv/tests/xml/while1.xml
trunk/yxmlconv/tests/xml/while1.ycp
trunk/yxmlconv/tests/xml/yebracket.xml
trunk/yxmlconv/tests/xml/yebracket.ycp
trunk/yxmlconv/tests/yebracket.rb
Added: trunk/yxmlconv/README
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/README?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/README (added)
+++ trunk/yxmlconv/README Mon Jul 16 12:46:10 2007
@@ -0,0 +1,61 @@
+ycpxml2ruby
+
+Intro
+-----
+
+yast2-core, since approx version 2.15.8, has the ability to transform
+YCP into and XML representation. This is based on the abstract syntax
+tree built up by the scanner/parser of libycp.
+
+The 'ycpc' CLI tool can be instructed (with the '-x' parameter) to output
+XML instead of yast bytecode.
+
+
+Usage
+-----
+
+'convert.rb' is the main file for the converter
+
+ycpc -c -x code.ycp -o code.xml
+
+ruby convert.rb code.xml > code.rb
+
+
+Files
+-----
+
+block.rb
+ Handling everything within <block>...</block>
+
+convert.rb
+ main()
+
+expressions.rb
+ Handling expressions
+
+helper.rb
+ Helper functions
+
+listener.rb
+ Main rexml stream listener class
+
+output.rb
+ Output handler
+ Cares for proper indentation and comment placing
+
+statements.rb
+ Handling statements
+
+symbols.rb
+ Handling symbol declarations
+
+
+ToDo
+----
+
+The ycp scanner throws comments away. These should be made available
+to the XML code and re-appear in the Ruby output.
+
+YCP variable names might clash with Ruby keywords.
+
+Implement builtins, like 'bracket', etc.
Added: trunk/yxmlconv/src/block.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/src/block.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/src/block.rb (added)
+++ trunk/yxmlconv/src/block.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,78 @@
+#
+# Block
+#
+
+require 'helper'
+require 'statements'
+require 'expressions'
+
+#------------------------------------------------
+# Parse <block> ... </block>
+#
+#
+class YBlock
+ def initialize kind = nil
+ @listener = nil
+ @kind = kind # "defstmt", "def", "stmt", "decl", "file", "expr"
+ @current = nil
+ end
+
+ def tag_start( name, attrs )
+ debug "++ #{self}.tag_start(#{name}) @listener #{@listener} @kind #{@kind} @current #{@current}"
+ if @listener then
+ result = @listener.tag_start( name, attrs )
+ return result if result # listener accepted
+ if @kind == "def" || @kind == "stmt" || @kind == "expr" # optional symbols not found, go on with statements
+ @listener = Statements.new
+ @current = :statements
+ return @listener.tag_start( name, attrs )
+ end
+ end
+ case name
+ when "block"
+ h = Helper.attrs2hash attrs
+ @kind = h["kind"] unless @kind
+ case @kind
+ when "defstmt"
+ @listener = Statements.new
+ @current = :statements
+ when "def", "stmt", "expr"
+ @listener = Symbols.new :definition
+ @current = :symbols
+ when "decl"
+ @listener = Symbols.new :declaration
+ @current = :symbols
+ when "file"
+ @listener = Symbols.new :module
+ @current = :symbols
+ else
+ raise "Unhandled kind #{@kind} in <block>"
+ end
+ else
+ raise "#{self}.tag_start(#{name}) kind #{@kind}, current #{@current} UNKNOWN"
+ end
+ return true
+ end
+
+ def tag_end( name )
+ debug "-- #{self}.tag_end(#{name}) @listener #{@listener} @kind #{@kind} @current #{@current}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ unless (@listener) then # listener just finished
+ if @current == :symbols && @kind != "decl" # symbols finished, continue with statements
+ @listener = Statements.new
+ @current = :statements
+ end
+ end
+ return true
+ end
+ case name
+ when "block"
+ debug "xx End of #{self}"
+ return false
+ else
+ raise "#{self}.tag_end(#{name}), @kind #{@kind} UNKNOWN"
+ end
+ return true
+ end
+end
Added: trunk/yxmlconv/src/convert.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/src/convert.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/src/convert.rb (added)
+++ trunk/yxmlconv/src/convert.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,29 @@
+#
+# ycp xml to ruby converter
+#
+
+require 'listener'
+
+argc = ARGV.length
+check = false
+output = STDOUT
+
+if (argc == 0) then
+ input = STDIN
+else
+ argp = 0
+ if (ARGV[argp] == "--debug") then
+ argp += 1
+ $debug = true
+ end
+ if (ARGV[argp] == "--check") then
+ argp += 1
+ check = true
+ output = File.new( "/dev/null", "w+" )
+ end
+ input = File.new( ARGV[argp] )
+ STDERR.puts "Checking #{ARGV[argp]}" if check
+end
+
+REXML::Document.parse_stream( input, YcpListener.new( output ) )
+puts ""
Added: trunk/yxmlconv/src/expressions.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/src/expressions.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/src/expressions.rb (added)
+++ trunk/yxmlconv/src/expressions.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,980 @@
+#
+# Expression
+#
+
+require 'helper'
+
+#------------------------------------------------
+# Parse
+#
+
+class YConstant
+ def tag_start( name, attrs )
+ h = Helper.attrs2hash attrs
+ debug "#{self}.tag_start(#{name}, #{h})"
+ case h["type"]
+ when "void"
+ $output.o( "nil" )
+ when "string", "path"
+ $output.o( '"' << h["value"] << '"' )
+ when "symbol"
+ $output.o( ':' << h["value"] )
+ else
+ $output.o( h["value"] )
+ end
+ end
+ def tag_end( name )
+ debug "YConstant.tag_end(#{name})"
+ return false if name == "const"
+ raise "#{self}.tag_end(#{name}) UNKNOWN"
+ end
+end
+
+#------------------------------------------------
+# Parse <list>...</list>
+#
+
+class YList
+ def initialize
+ @count = 0
+ @pending = nil
+ @listener = nil
+ @size = 0
+ end
+
+ def tag_start( name, attrs )
+ return @listener.tag_start( name, attrs ) if @listener
+ debug "#{self}.tag_start(#{name}) @listener #{@listener}"
+ if (@pending == :expression) then
+ if (@count > 0)
+ $output.o( :sep )
+ $output.o( [:eol] ) if @size > 3
+ end
+ @listener = YExpression.new
+ @pending = nil
+ return @listener.tag_start( name, attrs )
+ end
+ case name
+ when "element"
+ @pending = :expression
+ when "list"
+ h = Helper.attrs2hash attrs
+ @size = h["size"].to_i if h["size"]
+ $output.o( "[ " )
+ $output.o( [:eol, :inc] ) if @size > 3
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ return true
+ end
+ def tag_end( name )
+ debug "#{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @count += 1
+ @listener = nil unless @listener.tag_end( name )
+ return true
+ end
+ case name
+ when "list"
+ $output.o( [:eol, :dec] ) if @size > 3
+ $output.o( " ]" )
+ return false
+ when "element"
+ @pending = nil
+ return true
+ end
+ raise "#{self}.tag_end(#{name}) UNKNOWN" unless @listener
+ return true
+ end
+end
+
+
+#------------------------------------------------
+# Parse <map>...</map>
+#
+
+class YMap
+ def initialize
+ @count = 0
+ @pending = nil
+ @listener = nil
+ @have_key = false
+ @size = 0
+ end
+
+ def tag_start( name, attrs )
+ return @listener.tag_start( name, attrs ) if @listener
+ debug "#{self}.tag_start(#{name}) @pending #{@pending} @have_key #{@have_key}"
+ case @pending
+ when :kexpression, :vexpression
+ if ( (@count > 0) && (@pending == :kexpression)) then
+ $output.o( :sep )
+ $output.o( :eol ) if @size > 3
+ end
+ @listener = YExpression.new
+ @pending = :key if @pending == :kexpression
+ @pending = :value if @pending == :vexpression
+ debug "#{self}.tag_start(#{name}) @pending #{@pending} -> @listener #{@listener}"
+ return @listener.tag_start( name, attrs )
+ when :key
+ @pending = :kexpression
+ when :value
+ @pending = :vexpression
+ else begin
+ case name
+ when "map"
+ h = Helper.attrs2hash attrs
+ @size = h["size"].to_i if h["size"]
+ $output.o( "{ " )
+ $output.o( [:eol, :inc] ) if @size > 3
+ when "element"
+ raise "Value missing" if @have_key
+ @pending = :key
+ when "key"
+ raise "Duplicate key" if @have_key
+ @pending = :value
+ when "value"
+ raise "Value without key" unless @have_key
+ $output.o( " => " )
+ @pending = :vexpression
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+ end
+ return true
+ end
+ def tag_end( name )
+ debug "#{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ return true
+ end
+ case name
+ when "map"
+ $output.o( [:eol, :dec] ) if @size > 3
+ $output.o( " }" )
+ return false
+ when "key"
+ @pending = nil
+ @have_key = true
+ when "value"
+ @count += 1
+ @pending = nil
+ @have_key = false
+ else
+ raise "#{self}.tag_end(#{name}) UNKNOWN" if @listener
+ end
+ return true # wait for </map>
+ end
+end
+
+#------------------------------------------------
+# Parse @name } ) if (@count > 0)
+ raise "More than two expressions within <yebinary>" if @count > 2
+ @listener = YExpression.new
+ @pending = nil
+ return @listener.tag_start( name, attrs )
+ end
+ case name
+ when "yebinary"
+ h = Helper.attrs2hash attrs
+ @name = h["name"]
+ @pending = :expression
+ $output.o( :po )
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+ def tag_end( name )
+ debug "#{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ @pending = :expression
+ @count += 1 unless @listener
+ return true
+ end
+ case name
+ when "yebinary"
+ $output.o( :pc )
+ return false
+ end
+ raise "#{self}.tag_end(#{name}) UNKNOWN" unless @listener
+ return true
+ end
+end
+
+
+#------------------------------------------------
+# Parse <call> ... <args> ...
+#
+
+class YCall
+ def initialize
+ @count = 0
+ @pending = nil
+ @listener = nil
+ end
+
+ def tag_start( name, attrs )
+ return @listener.tag_start( name, attrs ) if @listener
+ debug "#{self}.tag_start(#{name}) @listener #{@listener}"
+ if (@pending == :expression) then
+ $output.o( :sep ) if (@count > 0)
+ @listener = YExpression.new
+ @pending = nil
+ return @listener.tag_start( name, attrs )
+ end
+ case name
+ when "args"
+ @pending = :expression
+ when "call"
+ h = Helper.attrs2hash attrs
+ if h["ns"] && (!h["ns"].empty?) then
+ $output.o( :ycp => h["ns"] )
+ $output.o( :str => "::" )
+ end
+ $output.o( h["name"] )
+ $output.o( :po )
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ return true
+ end
+
+ def tag_end( name )
+ debug "#{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @count += 1
+ @listener = nil unless @listener.tag_end( name )
+ @pending = :expression
+ return true
+ end
+ case name
+ when "call"
+ $output.o( :pc )
+ return false
+ when "args"
+ @pending = nil
+ return true
+ end
+ raise "#{self}.tag_end(#{name}) UNKNOWN" unless @listener
+ return true
+ end
+end
+
+
+#------------------------------------------------
+# Parse <yeterm> ... <element> ... </yeterm>
+#
+
+class YETerm
+ def initialize
+ @count = 0
+ @pending = nil
+ @listener = nil
+ end
+
+ def tag_start( name, attrs )
+ return @listener.tag_start( name, attrs ) if @listener
+ debug "#{self}.tag_start(#{name}) @listener #{@listener}"
+ if (@pending == :expression) then
+ $output.o( :sep ) if (@count > 0)
+ @listener = YExpression.new
+ @pending = nil
+ return @listener.tag_start( name, attrs )
+ end
+ case name
+ when "element"
+ @pending = :expression
+ when "yeterm"
+ h = Helper.attrs2hash attrs
+ $output.o( h["name"] )
+ $output.o( :po )
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ return true
+ end
+
+ def tag_end( name )
+ debug "#{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @count += 1
+ @listener = nil unless @listener.tag_end( name )
+ @pending = :expression
+ return true
+ end
+ case name
+ when "yeterm"
+ $output.o( :pc )
+ return false
+ when "element"
+ @pending = nil
+ return true
+ end
+ raise "#{self}.tag_end(#{name}) UNKNOWN" unless @listener
+ return true
+ end
+end
+
+
+#------------------------------------------------
+# Parse 0)
+ @listener = YExpression.new
+ @pending = nil
+ return @listener.tag_start( name, attrs )
+ end
+ case name
+ when "element"
+ @pending = :expression
+ when "builtin"
+ h = Helper.attrs2hash attrs
+ if h["sym0"] then
+ @name = h["name"]
+ @symbols = Array.new
+ count = 0
+ loop do
+ s = h["sym"+count.to_s]
+ break unless s
+ $output.o( { :com => s } )
+ @symbols << s.split(" ").last
+ count += 1
+ end
+ @listener = YExpression.new :enclosed
+ @pending = :block
+ $output.o( :po )
+ return true
+ end
+ if h["ns"] && (!h["ns"].empty?) then
+ $output.o( :ycp => h["ns"] )
+ $output.o( :str => "::" )
+ end
+ $output.o( :bui )
+ $output.o( h["name"] )
+ $output.o( :po )
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ return true
+ end
+
+ def tag_end( name )
+ debug "#{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ return true if @listener
+ @count += 1
+ if @pending == :block then
+ @listener = YExpression.new
+ $output.o( [ :pc, ".", @name, " {", "|" ] )
+ first = true
+ @symbols.each { |sym|
+ $output.o( :sep ) unless first
+ $output.o( sym )
+ first = false
+ }
+ $output.o( [ "|", :eol, :inc ] )
+ end
+ @pending = :expression
+ return true
+ end
+ case name
+ when "builtin"
+ if @symbols then
+ $output.o( [ :eol, :dec, "}" ] )
+ else
+ $output.o( :pc )
+ end
+ return false
+ when "element"
+ @pending = nil
+ return true
+ end
+ raise "#{self}.tag_end(#{name}) UNKNOWN" unless @listener
+ return true
+ end
+end
+
+
+#------------------------------------------------
+# Parse
+#
+
+class YLocale
+ def initialize
+ @listener = nil
+ end
+
+ def tag_start( name, attrs )
+ return @listener.tag_start( name, attrs ) if @listener
+ case name
+ when "locale"
+ h = Helper.attrs2hash attrs
+ if h["plural"] then
+ $output.o( { :nlo => [ h["text"], h["plural"] ] } )
+ @listener = YExpression.new
+ $output.o( :pc )
+ else
+ $output.o( { :loc => h["text"] } )
+ end
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ return true
+ end
+
+ def tag_end( name )
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ return true
+ end
+ case name
+ when "locale"
+ return false
+ else
+ raise "#{self}.tag_end(#{name}) UNKNOWN"
+ end
+ return true
+ end
+end
+
+#------------------------------------------------
+# Parse
+#
+
+class YVariable
+ def tag_start( name, attrs )
+ case name
+ when "variable"
+ h = Helper.attrs2hash attrs
+ $output.o( { :var => h["name"] } )
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ return true
+ end
+
+ def tag_end( name )
+ case name
+ when "variable"
+ return false
+ else
+ raise "#{self}.tag_end(#{name}) UNKNOWN"
+ end
+ return false
+ end
+end
+
+#------------------------------------------------
+# Parse
+#
+
+class YEntry
+ def tag_start( name, attrs )
+ case name
+ when "entry"
+ h = Helper.attrs2hash attrs
+ $output.o( { :var => h["name"] } )
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ return true
+ end
+ def tag_end( name )
+ case name
+ when "entry"
+ return false
+ else
+ raise "#{self}.tag_end(#{name}) UNKNOWN"
+ end
+ return false
+ end
+end
+
+#------------------------------------------------
+# Parse <compare> ... </compare>
+#
+#
+class YCompare
+ def initialize
+ @listener = nil
+ @pending = nil
+ @op = nil
+ end
+
+ def tag_start( name, attrs )
+ debug "++ #{self}.tag_start(#{name}) @listener #{@listener}"
+ return @listener.tag_start( name, attrs ) if @listener
+ if (@pending == :expression) then
+ @listener = YExpression.new
+ @pending = nil
+ return @listener.tag_start( name, attrs )
+ end
+ case name
+ when "compare"
+ @pending = :lhs
+ h = Helper.attrs2hash attrs
+ @op = h["op"]
+ when "lhs", "rhs"
+ @pending = :expression
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+
+ def tag_end( name )
+ debug "-- #{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ return true
+ end
+ case name
+ when "compare"
+ raise "Unclosed compare, pending #{@pending}" unless @pending == nil
+ debug "xx End of #{self}"
+ return false
+ when "lhs"
+ @pending = :rhs
+ $output.o( { :op => @op } )
+ when "rhs"
+ @pending = nil
+ else
+ raise "#{self}.tag_end(#{name}) UNKNOWN"
+ end
+ return true
+ end
+end
+
+
+#------------------------------------------------
+# Parse <yepropagate> ... </yepropagate>
+#
+#
+class YEPropagate
+ def initialize
+ @listener = nil
+ end
+
+ def tag_start( name, attrs )
+ debug "++ #{self}.tag_start(#{name}) @listener #{@listener}"
+ return @listener.tag_start( name, attrs ) if @listener
+ case name
+ when "yepropagate"
+ @listener = YExpression.new
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+
+ def tag_end( name )
+ debug "-- #{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ return true
+ end
+ case name
+ when "yepropagate"
+ debug "xx End of #{self}"
+ return false
+ else
+ raise "#{self}.tag_end(#{name}) UNKNOWN"
+ end
+ return true
+ end
+end
+
+
+#------------------------------------------------
+# Parse <yebracket> ... </yebracket>
+#
+#
+class YEBracket
+ def initialize
+ @listener = nil
+ @current = nil
+ end
+
+ def tag_start( name, attrs )
+ debug "++ #{self}.tag_start(#{name}) @listener #{@listener} @current #{@current}"
+ return @listener.tag_start( name, attrs ) if @listener
+ case name
+ when "yebracket"
+ @listener = YExpression.new
+ @current = :expression
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ return true
+ end
+
+ def tag_end( name )
+ debug "-- #{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ unless @listener
+ case @current
+ when :expression # expression ended, continue with list
+ $output.o( ".bracket" )
+ $output.o( :po )
+ @listener = YList.new
+ @current = :list
+ when :list # list ended, continue with default
+ @listener = YExpression.new
+ @current = :default
+ $output.o( :sep )
+ when :default
+ @current = nil
+ $output.o( :pc )
+ end
+ end
+ return true
+ end
+ case name
+ when "yebracket"
+ raise "Unclosed bracket" unless @current == nil
+ debug "xx End of #{self}"
+ return false
+ else
+ raise "#{self}.tag_end(#{name}) UNKNOWN"
+ end
+ return true
+ end
+end
+
+
+#------------------------------------------------
+# Parse <yereturn> ...
+#
+#
+class YEReturn
+ def initialize
+ @listener = nil
+ end
+
+ def tag_start( name, attrs )
+ debug "++ #{self}.tag_start(#{name}) @listener #{@listener}"
+ return @listener.tag_start( name, attrs ) if @listener
+ case name
+ when "yereturn"
+ @listener = YExpression.new
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+
+ def tag_end( name )
+ debug "-- #{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ return true
+ end
+ case name
+ when "yereturn"
+ debug "xx End of #{self}"
+ return false
+ else
+ raise "#{self}.tag_end(#{name}) UNKNOWN"
+ end
+ return true
+ end
+end
+
+
+#------------------------------------------------
+# Parse <ycpcode> ...
+#
+#
+class YcpCode
+ def initialize
+ @listener = nil
+ end
+
+ def tag_start( name, attrs )
+ debug "++ #{self}.tag_start(#{name}) @listener #{@listener}"
+ return @listener.tag_start( name, attrs ) if @listener
+ case name
+ when "ycpcode"
+ @listener = YExpression.new
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+
+ def tag_end( name )
+ debug "-- #{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ return true
+ end
+ case name
+ when "ycpcode"
+ debug "xx End of #{self}"
+ return false
+ else
+ raise "#{self}.tag_end(#{name}) UNKNOWN"
+ end
+ return true
+ end
+end
+
+
+#------------------------------------------------
+# Parse <yeis> ...
+#
+#
+class YEIs
+ def initialize
+ @listener = nil
+ @type = nil
+ end
+
+ def tag_start( name, attrs )
+ debug "++ #{self}.tag_start(#{name}) @listener #{@listener}"
+ return @listener.tag_start( name, attrs ) if @listener
+ case name
+ when "yeis"
+ h = Helper.attrs2hash attrs
+ @type = h["type"]
+ @type = "hash" if @type == "map"
+ @listener = YExpression.new :enclosed
+ $output.o( :po )
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+
+ def tag_end( name )
+ debug "-- #{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ return true
+ end
+ case name
+ when "yeis"
+ $output.o( :pc )
+ $output.o( ".class == " << @type.capitalize )
+ debug "xx End of #{self}"
+ return false
+ else
+ raise "#{self}.tag_end(#{name}) UNKNOWN"
+ end
+ return true
+ end
+end
+
+
+#------------------------------------------------
+# Parse <yetriple>
+#
+#
+class YETriple
+ def initialize
+ @listener = nil
+ @pending = nil
+ end
+
+ def tag_start( name, attrs )
+ debug "++ #{self}.tag_start(#{name}) @listener #{@listener}"
+ return @listener.tag_start( name, attrs ) if @listener
+ case name
+ when "yetriple"
+ @pending = :cond
+ when "cond", "true", "false"
+ @listener = YExpression.new
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ return true
+ end
+
+ def tag_end( name )
+ debug "-- #{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ return true
+ end
+ case name
+ when "yetriple"
+ raise "Unclosed yetriple, pending #{@pending}" unless @pending == nil
+ debug "xx End of #{self}"
+ return false
+ when "cond", "true"
+ $output.o( " ? " ) if name == "cond"
+ $output.o( " : " ) if name == "true"
+ @pending = nil
+ when "false"
+ @listener = nil
+ else
+ raise "#{self}.tag_end(#{name}) UNKNOWN"
+ end
+ return true
+ end
+end
+
+
+#------------------------------------------------
+#
+# YExpression listener
+# Listens to tags specifying an expression
+# if tag_end returns false, tear down listener
+#
+# Expressions dont have an enclosing tag, their listeners
+# define the end
+#
+class YExpression
+ def initialize kind = :pure # or :enclosed, for statements
+ @listener = nil
+ @kind = kind
+ end
+
+ def tag_start( name, attrs )
+ debug "++ #{self}.tag_start(#{name}) @listener #{@listener}"
+ return @listener.tag_start( name, attrs ) if @listener
+ case name
+ when "expr"
+ return @kind == :enclosed
+ when "const"
+ @listener = YConstant.new
+ when "list"
+ @listener = YList.new
+ when "map"
+ @listener = YMap.new
+ when "yeunary"
+ @listener = YEUnary.new
+ when "yebinary"
+ @listener = YEBinary.new
+ when "call"
+ @listener = YCall.new
+ when "yeterm"
+ @listener = YETerm.new
+ when "builtin"
+ @listener = YBuiltin.new
+ when "locale"
+ @listener = YLocale.new
+ when "variable"
+ @listener = YVariable.new
+ when "compare"
+ @listener = YCompare.new
+ when "yepropagate"
+ @listener = YEPropagate.new
+ when "yebracket"
+ @listener = YEBracket.new
+ when "entry"
+ @listener = YEntry.new
+ when "yereturn"
+ @listener = YEReturn.new
+ when "block"
+ @listener = YBlock.new "expr"
+ when "yetriple"
+ @listener = YETriple.new
+ when "ycpcode"
+ @listener = YcpCode.new
+ when "yeis"
+ @listener = YEIs.new
+ else
+ raise "#{self}.tag_start(#{name}) UNHANDLED"
+ end
+ @listener.tag_start( name, attrs )
+ end
+
+ def text( text )
+ $output.o( { :com => "YExpression text >" << text << "< @listener #{@listener}" } )
+ end
+
+ def tag_end( name )
+ debug "-- #{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then # const, list, map, ...
+ @listener = nil unless @listener.tag_end( name )
+ return true if @listener
+ return true if @kind == :enclosed # wait for </expr>
+ return false unless @listener # pure end
+ end
+ debug "xx End of expression #{self}: #{name}, kind #{@kind}"
+ case name
+ when "expr"
+ return false if @kind == :enclosed
+ raise "#{self}: Unenclosed </expr>"
+ else
+ raise "#{self}.tag_end(#{name}) UNHANDLED"
+ end
+ return false
+ end
+end
+
+
Added: trunk/yxmlconv/src/helper.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/src/helper.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/src/helper.rb (added)
+++ trunk/yxmlconv/src/helper.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,36 @@
+#
+# helper.rb
+#
+
+$ycpversion = ""
+$debug = false
+
+def debug s
+ STDERR.puts "\n** #{s}" if $debug
+end
+
+#------------------------------------------------
+# Helper class
+#
+
+class Helper
+ def Helper.attrs2hash attrs
+ h = Hash.new
+ attrs.each { |a|
+ begin
+ h[a[0]] = a[1]
+ rescue
+ raise "Invalid attribute element #{a}"
+ end
+ }
+ h
+ end
+
+ def indent level
+ level.times " "
+ end
+
+end
+
+
+
Added: trunk/yxmlconv/src/listener.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/src/listener.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/src/listener.rb (added)
+++ trunk/yxmlconv/src/listener.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,93 @@
+#
+# ycp xml to ruby converter
+#
+
+# Based on the rexml stream listener
+
+# Each listener class has @listener to pass on tag_start()
+# and tag_end() callbacks
+#
+# The chain of @listeners defines the 'state' of the parser
+# inside the XML tree
+# This way, the nested nature of xml can easily be handled
+#
+# The current XML generated from YaST has some optional
+# xml tags which need a one-token-lookahead strategy.
+# This is implemented by making the tag_start() return
+# boolean.
+#
+# If tag_start() returns true, this means the current listener
+# accepted the tag and is able to handle the complete xml sub-tree
+# following that tag.
+#
+# The xml sub-tree ends when the tag_end() callback returns
+# false.
+#
+#
+
+$LOAD_PATH << File.dirname(__FILE__) # find all other files in same dir
+
+require 'rexml/document'
+require 'output'
+require 'helper'
+require 'expressions'
+require 'statements'
+require 'symbols'
+
+#------------------------------------------------
+# Parse <ycp>...</ycp>
+#
+#
+
+class YcpListener
+
+ attr_reader :state
+
+ def initialize( output, flags = [] )
+ # :undef, :ycp, :file, :module, :symbols, :statements, :fundef
+ @state = :undef
+ @listener = nil
+ $output = Output.new( output, flags )
+ end
+
+ def xmldecl( version, encoding, standalone )
+ $ycpversion = version
+ end
+
+ def text( s )
+ s.strip!
+ return if s.empty?
+ return @listener.text( s ) if @listener
+ end
+
+ def tag_start( name, attrs )
+ debug "++ #{self.class}.tag_start(#{name}) @listener #{@listener}"
+ return @listener.tag_start( name, attrs ) if @listener
+ out = nil
+ case name
+ when "ycp"
+ @state = :ycp
+ when "block"
+ @listener = YBlock.new
+ else
+ raise "YcpListener: Unhandled tag_start '#{name}'"
+ end
+ @listener.tag_start( name, attrs ) if @listener
+ end
+
+ def tag_end( name )
+ debug "-- #{self.class}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ return true # this listener has its own end tag
+ end
+ case name
+ when "ycp": @state = :undef
+ when "block": @state = :ycp
+ else
+ raise "YcpListener: Unhandled tag_end '#{name}'"
+ end
+ end
+
+end
+
Added: trunk/yxmlconv/src/output.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/src/output.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/src/output.rb (added)
+++ trunk/yxmlconv/src/output.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,167 @@
+#
+# Output handler for ycpxml2ruby
+#
+class Output
+ def initialize stream, flags = []
+ @indent = 0
+ @spaces = ""
+ @stream = stream
+ @indentation_pending = true
+ @comments = nil
+ @flag_comments = true
+ flags.each { |f|
+ @flag_comments = false if f == :no_comments
+ }
+ end
+
+ def inc
+ @indent += 1
+ @spaces << " "
+ end
+
+ def dec
+ @indent -= 1
+ raise "Indentation level < 0" if @indent < 0
+ @spaces.chop!
+ @spaces.chop!
+ end
+
+ def indent
+ if @comments then
+ @comments.each { |c|
+ @stream << @spaces << "# " << c << "\n"
+ }
+ @comments = nil
+ end
+ @stream << @spaces
+ @indentation_pending = false
+ end
+
+ # output newline
+ def nl
+ @stream << "\n"
+ @indentation_pending = true
+ end
+
+ # output string
+ def str s
+ indent() if @indentation_pending
+ @stream << s
+ end
+
+ def out k, v = nil
+ case k
+ when :fun
+ nl()
+ str "def "
+ str v
+ inc()
+ when :beg
+ str " begin"
+ nl()
+ inc()
+ when :end
+ nl()
+ dec()
+ str "end"
+ when :com
+ @comments = Array.new unless @comments
+ @comments << v if @flag_comments
+ when :inc
+ inc()
+ when :dec
+ dec()
+ when :eol
+ nl()
+ when :str
+ str v
+ when :var
+ str v
+ when :bui
+ str "Ycp::Builtin::"
+ when :typ
+ out :com, "Type " << v
+ when :po
+ str "( "
+ when :pc
+ str " )"
+ when :cbo
+ str "{"
+ nl()
+ inc()
+ when :cbc
+ nl()
+ dec()
+ str "}"
+ nl()
+ when :sep
+ str ", "
+ when :op
+ str " " << v << " "
+ when :ycp
+ str "Ycp::" << v
+ when :loc
+ str "_( \"" << v << "\" )"
+ when :nlo
+ str "_( \"" << v[0] << "\", \"" << v[1] << "\", "
+ when :imp
+ str "require 'ycp/" << v << "'"
+ when :tdm
+ str "Ycp::Textdomain '" << v << "'"
+ when :do
+ str " do"
+ nl()
+ inc()
+ else
+ raise "#{self}.out called with unknown key #{k}"
+ end
+ end
+
+ #
+ # output h = String, Symbol, Array or Hash
+ # :fun => "name" start function definition (implies :beg)
+ # :beg => nil begin (implies :eol, :inc)
+ # :end => nil end (implies :eol, :dec)
+ # :com => "comment" comment (delayed output)
+ # :inc => nil increment indentation
+ # :dec => nil decrement indentation
+ # :eol => nil end-of-line (indent next output)
+ # :str => "string"
+ # :var => "variable"
+ # :bui => "builtin"
+ # :typ => "type"
+ # :po, :pc Paranthese open, close ( )
+ # :cbo, :cbc Curly brace open for blocks!, close { }, implies :eol
+ # :op => "operator" Infix operator
+ # :ycp => ycp namespace Ycp::
+ # :loc => "localized text"
+ # :nlo => "localized text with singular/plural", :pc follows
+ # :imp => import
+ # :mod => module
+ # :do => nil do (implies :eol, :inc)
+ #
+ def o h
+ if h.class == Symbol then
+ out h
+ else if h.class == String then
+ out :str, h
+ else if h.class == Array then
+ h.each { |v|
+ out v, nil if v.class == Symbol
+ out :str, v if v.class == String
+ }
+ else if h.class == Hash then
+ raise "Hash does not preserve ordering" if h.size > 1
+ h.each { |k,v|
+ out k, v
+ }
+ else
+ raise "#{self}.o called with unknown parameter of class #{h.class}"
+ end
+ end
+ end
+ end
+ end
+
+end
+
Added: trunk/yxmlconv/src/statements.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/src/statements.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/src/statements.rb (added)
+++ trunk/yxmlconv/src/statements.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,774 @@
+#
+# Statements
+#
+
+require 'helper'
+require 'block'
+require 'expressions'
+
+#------------------------------------------------
+# Parse
+#
+class YBreak
+ def tag_start( name, attrs )
+ case name
+ when "break"
+ $output.o( "break" )
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+ def tag_end( name )
+ case name
+ when "break"
+ return false
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+end
+
+#------------------------------------------------
+# Parse
+#
+class YContinue
+ def tag_start( name, attrs )
+ case name
+ when "continue"
+ $output.o( "next" )
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+ def tag_end( name )
+ case name
+ when "continue"
+ return false
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+end
+
+#------------------------------------------------
+# Parse
+#
+class YFilename
+ def tag_start( name, attrs )
+ case name
+ when "filename"
+ h = Helper.attrs2hash attrs
+ $output.o( { :com => "filename: " << h["name"] } )
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+ def tag_end( name )
+ case name
+ when "filename"
+ return false
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+end
+
+#------------------------------------------------
+# Parse
+#
+class YImport
+ def tag_start( name, attrs )
+ case name
+ when "import"
+ h = Helper.attrs2hash attrs
+ $output.o( { :imp => h["name"] } )
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+ def tag_end( name )
+ case name
+ when "import"
+ return false
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+end
+
+#------------------------------------------------
+# Parse
+#
+class YInclude
+ def tag_start( name, attrs )
+ case name
+ when "include"
+ h = Helper.attrs2hash attrs
+ $output.o( { :com => "include " << h["name"] } )
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+ def tag_end( name )
+ case name
+ when "include"
+ return false
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+end
+
+#------------------------------------------------
+# Parse
+#
+class YTextdomain
+ def tag_start( name, attrs )
+ case name
+ when "textdomain"
+ h = Helper.attrs2hash attrs
+ $output.o( { :tdm => h["name"] } )
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+ def tag_end( name )
+ case name
+ when "textdomain"
+ return false
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+end
+
+
+#------------------------------------------------
+# Parse <if> ... </if>
+#
+#
+class YIf
+ def initialize
+ @listener = nil
+ @pending = nil
+ end
+
+ def tag_start( name, attrs )
+ debug "++ #{self}.tag_start(#{name}) @listener #{@listener} @pending #{@pending}"
+ return @listener.tag_start( name, attrs ) if @listener
+ if (@pending == :expression) then
+ @listener = YExpression.new
+ @pending = nil
+ end
+ if (@pending == :statement) then
+ @listener = YStatement.new :pure
+ @pending = nil
+ end
+ return @listener.tag_start( name, attrs ) if @listener
+ case name
+ when "if"
+ @pending = :expression
+ $output.o( "if" )
+ $output.o( :po )
+ when "then"
+ $output.o( [ :pc, " then", :eol, :inc ] )
+ @pending = :statement
+ when "else"
+ $output.o( [ :eol, :dec, "else", :eol, :inc ] )
+ @pending = :statement
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ return true
+ end
+
+ def tag_end( name )
+ debug "-- #{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ return true # wait for </if>
+ end
+ case name
+ when "if"
+ raise "Unclosed if" unless @pending == nil
+ debug "xx End of #{self}"
+ $output.o( :end )
+ return false
+ when "then", "else"
+ @pending = nil
+ else
+ raise "#{self}.tag_end(#{name}) UNKNOWN"
+ end
+ return true
+ end
+end
+
+
+#------------------------------------------------
+# Parse <assign> ... </assign>
+#
+#
+class YAssign
+ def initialize
+ @listener = nil
+ end
+
+ def tag_start( name, attrs )
+ debug "++ #{self}.tag_start(#{name}) @listener #{@listener}"
+ return @listener.tag_start( name, attrs ) if @listener
+ case name
+ when "assign"
+ h = Helper.attrs2hash attrs
+ $output.o( { :var => h["name"] } )
+ $output.o( { :op => "=" } )
+ @listener = YExpression.new
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+
+ def tag_end( name )
+ debug "-- #{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ return true
+ end
+ case name
+ when "assign"
+ raise "Unclosed assign" unless @pending == nil
+ debug "xx End of #{self}"
+ return false
+ else
+ raise "#{self}.tag_end(#{name}) UNKNOWN"
+ end
+ return true
+ end
+end
+
+
+#------------------------------------------------
+# Parse <bracket> ... </bracket>
+#
+#
+class YBracket
+ def initialize
+ @listener = nil
+ @pending = nil
+ end
+
+ def tag_start( name, attrs )
+ debug "++ #{self}.tag_start(#{name}) @listener #{@listener}"
+ return @listener.tag_start( name, attrs ) if @listener
+ case @pending
+ when :expression
+ @listener = YExpression.new
+ @pending = nil
+ when :list
+ @listener = YList.new
+ @pending = nil
+ end
+ return @listener.tag_start( name, attrs ) if @listener
+ case name
+ when "bracket"
+ @pending = :lhs
+ when "lhs"
+ @pending = :entry
+ when "entry"
+ @pending = :arg
+ h = Helper.attrs2hash attrs
+ $output.o( h["name"] )
+ when "arg"
+ @pending = :list
+ when "rhs"
+ @pending = :expression
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+
+ def tag_end( name )
+ debug "-- #{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ return true
+ end
+ case name
+ when "bracket"
+ raise "Unclosed bracket" unless @pending == nil
+ debug "xx End of #{self}"
+ return false
+ when "arg", "entry"
+ return true
+ when "lhs"
+ @pending = :rhs
+ $output.o( { :op => "=" } )
+ when "rhs"
+ @pending = nil
+ else
+ raise "#{self}.tag_end(#{name}) UNKNOWN"
+ end
+ return true
+ end
+end
+
+
+#------------------------------------------------
+# Parse <return> ... </return>
+#
+# expression is optional, so set up listener _and_ step
+# if tag_start is called again, we have an expression
+# else check in tag_end if we have/had an expression
+# if not, tear down listener and dont call tag_end of listener
+#
+class YReturn
+ def initialize
+ @listener = nil
+ @step = :before_start # :before_expr, :during_expr, :after_expr
+ end
+
+ def tag_start( name, attrs )
+ debug "++ #{self}.tag_start(#{name}) @step #{@step} @listener #{@listener}"
+ if @step == :before_expr then
+ $output.o( " " )
+ @step = :during_expr
+ end
+ return @listener.tag_start( name, attrs ) if @listener
+ case name
+ when "return"
+ $output.o( "return" )
+ @listener = YExpression.new
+ @step = :before_expr
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ return true
+ end
+
+ def tag_end( name )
+ debug "-- #{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener && @step != :before_expr) then
+ @listener = nil unless @listener.tag_end( name )
+ return true
+ end
+ case name
+ when "return"
+ debug "xx End of #{self}"
+ return false
+ else
+ raise "#{self}.tag_end(#{name}) UNKNOWN"
+ end
+ return false
+ end
+end
+
+
+#------------------------------------------------
+# Parse <declaration> ... </declaration>
+#
+#
+class YDeclaration
+ def initialize
+ @listener = nil
+ end
+
+ def tag_start( name, attrs )
+ debug "++ #{self}.tag_start(#{name}) @listener #{@listener}"
+ return @listener.tag_start( name, attrs ) if @listener
+ case name
+ when "declaration"
+ @listener = YBlock.new "decl"
+ return true
+ end
+ $output.o( [ :po, :pc, :eol ] )
+ return false # declaration is optional
+ end
+
+ def text( text )
+ $output.o( { :com => "YDeclaration text >" << text << "<" } )
+ return @listener.text( text ) if @listener
+ end
+
+ def tag_end( name )
+ debug "-- #{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ return true
+ end
+ case name
+ when "declaration"
+ debug "xx End of #{self}"
+ return false
+ else
+ raise "#{self}.tag_end(#{name}) UNKNOWN"
+ end
+ return true
+ end
+end
+
+
+#------------------------------------------------
+# Parse ...
+#
+#
+class YFunDef
+ def initialize
+ @listener = nil
+ @pending = nil
+ end
+
+ def tag_start( name, attrs )
+ debug "++ #{self}.tag_start(#{name}) @listener #{@listener}"
+ if @listener then
+ result = @listener.tag_start( name, attrs )
+ return result if result
+ if @pending == :declaration then
+ @listener = YBlock.new
+ @pending = :definition
+ return @listener.tag_start( name, attrs )
+ end
+ end
+ case name
+ when "fun_def"
+ @pending = :declaration
+ @listener = YDeclaration.new
+ h = Helper.attrs2hash attrs
+ $output.o( { :fun => h["name"] } )
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ end
+
+ def text( text )
+ $output.o( { :com => "YFunDef text >" << text << "<" } )
+ return @listener.text( text ) if @listener
+ end
+
+ def tag_end( name )
+ debug "-- #{self}.tag_end(#{name}) @listener #{@listener}, @pending #{@pending}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ unless @listener
+ if @pending == :declaration
+ @listener = YBlock.new
+ @pending = nil
+ end
+ end
+ return true
+ end
+ case name
+ when "fun_def"
+ $output.o( [ :end, :eol ] )
+ debug "xx End of #{self}"
+ return false
+ else
+ raise "#{self}.tag_end(#{name}) UNKNOWN"
+ end
+ return true
+ end
+end
+
+
+#------------------------------------------------
+# Parse <while> <cond>...</cond> [ <do>...</do> ] </while>
+#
+# after <do>, either <block> or a statement follow. Ugly.
+# And even <do> is optional. More ugly.
+#
+class YWhile
+ def initialize
+ @listener = nil
+ @pending = nil
+ end
+
+ def tag_start( name, attrs )
+ debug "++ #{self}.tag_start(#{name}) @listener #{@listener}"
+ return @listener.tag_start( name, attrs ) if @listener
+ case name
+ when "while"
+ @pending = :cond
+ $output.o( [ "while", :po ] )
+ when "cond"
+ @listener = YExpression.new
+ when "do"
+ @pending = :statement
+ when "block"
+ if @pending == :statement
+ @listener = YBlock.new
+ return @listener.tag_start( name, attrs )
+ end
+ else
+ if @pending == :statement
+ @listener = YStatement.new :pure
+ return @listener.tag_start( name, attrs )
+ end
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ return true
+ end
+
+ def tag_end( name )
+ debug "-- #{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ return true
+ end
+ case name
+ when "while"
+ raise "Unclosed while" unless @pending == nil
+ $output.o( :end )
+ debug "xx End of #{self}"
+ return false
+ when "cond"
+ $output.o( [ :pc, :eol, :inc ] ) # :end implies :dec
+ @pending = :do
+ when "do"
+ @pending = nil
+ else
+ raise "#{self}.tag_end(#{name}) UNKNOWN"
+ end
+ return true
+ end
+end
+
+
+#------------------------------------------------
+# Parse <repeat> <do>...</do> <until>...</until> </repeat>
+#
+# after <do>, either <block> or a statement follow. Ugly.
+#
+class YRepeat
+ def initialize
+ @listener = nil
+ @pending = nil
+ end
+
+ def tag_start( name, attrs )
+ debug "++ #{self}.tag_start(#{name}) @listener #{@listener}"
+ return @listener.tag_start( name, attrs ) if @listener
+ case name
+ when "repeat"
+ @pending = :do
+ when "until"
+ @listener = YExpression.new
+ $output.o( [ :eol, "until", :po ] )
+ when "do"
+ @pending = :statement
+ $output.o( [ "repeat", :beg ] )
+ when "block"
+ if @pending == :statement
+ @listener = YBlock.new "stmt"
+ return @listener.tag_start( name, attrs )
+ end
+ else
+ if @pending == :statement
+ @listener = YStatement.new :pure
+ return @listener.tag_start( name, attrs )
+ end
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ return true
+ end
+
+ def tag_end( name )
+ debug "-- #{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ return true
+ end
+ case name
+ when "repeat"
+ raise "Unclosed repeat" unless @pending == nil
+ debug "xx End of #{self}"
+ return false
+ when "do"
+ @pending = :until
+ $output.o( :end )
+ when "until"
+ @pending = nil
+ $output.o( :pc )
+ else
+ raise "#{self}.tag_end(#{name}) UNKNOWN"
+ end
+ return true
+ end
+end
+
+
+#------------------------------------------------
+# Parse <do>...</do> <until>...</until> </repeat>
+#
+# after <do>, either <block> or a statement follow. Ugly.
+#
+class YDo
+ def initialize
+ @listener = nil
+ end
+
+ def tag_start( name, attrs )
+ debug "++ #{self}.tag_start(#{name}) @listener #{@listener}"
+ return @listener.tag_start( name, attrs ) if @listener
+ case name
+ when "do"
+ @listener = YBlock.new "stmt"
+ $output.o( [ "loop", :do ] )
+ when "while"
+ $output.o( [ :eol, "break", " unless", :po ] )
+ @listener = YExpression.new
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ return true
+ end
+
+ def tag_end( name )
+ debug "-- #{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ return true
+ end
+ case name
+ when "do"
+ $output.o( :end )
+ debug "xx End of #{self}"
+ return false
+ when "while"
+ $output.o( :pc )
+ else
+ raise "#{self}.tag_end(#{name}) UNKNOWN"
+ end
+ return true
+ end
+end
+
+
+#------------------------------------------------
+#
+# YStatement listener
+# Listens to single statements
+# if tag_end returns false, tear down listener
+
+class YStatement
+ def initialize kind = :enclosed # or :pure - without enclosing <stmt>
+ @listener = nil
+ @kind = kind
+ end
+
+ def tag_start( name, attrs )
+ debug "++ #{self}.tag_start(#{name}) @listener #{@listener} @pending #{@pending}"
+ unless @listener then
+ case name
+ when "stmt"
+ raise "<stmt> unenclosed" unless @kind == :enclosed
+ return true
+ when "return"
+ @listener = YReturn.new
+ when "assign"
+ @listener = YAssign.new
+ when "if"
+ @listener = YIf.new
+ when "block"
+ @listener = YBlock.new "stmt"
+ when "import"
+ @listener = YImport.new
+ when "textdomain"
+ @listener = YTextdomain.new
+ when "fun_def"
+ @listener = YFunDef.new
+ when "expr"
+ @listener = YExpression.new :enclosed
+ when "bracket"
+ @listener = YBracket.new
+ when "include"
+ @listener = YInclude.new
+ when "filename"
+ @listener = YFilename.new
+ when "while"
+ @listener = YWhile.new
+ when "repeat"
+ @listener = YRepeat.new
+ when "do"
+ @listener = YDo.new
+ when "continue"
+ @listener = YContinue.new
+ when "break"
+ @listener = YBreak.new
+ else
+ raise "#{self}.tag_start(#{name}) UNHANDLED"
+ end
+ end
+ return @listener.tag_start( name, attrs )
+ end
+
+ def text( s )
+ STDERR.puts "#{@listener} text >" << s << "<"
+ return @listener.text( s ) if @listener
+ end
+
+ def tag_end( name )
+ debug "-- #{self}.tag_end(#{name}) @listener #{@listener} @kind #{@kind}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ return @kind == :enclosed unless @listener # false if :pure and listener is done
+ return true
+ end
+ raise "#{self}.tag_end(#{name}) UNHANDLED" unless name == "stmt"
+ return false
+ end
+end
+
+
+#------------------------------------------------
+#
+# Statements listener
+# Handles <statements>...</statements>
+# if tag_end returns false, tear down listener
+
+class Statements
+ def initialize
+ @listener = nil
+ @count = 0
+ @pending = nil
+ end
+
+ def tag_start( name, attrs )
+ debug "++ #{self}.tag_start(#{name}) @listener #{@listener} @count #{@count}"
+ if @pending == :statement then
+ @listener = YStatement.new
+ @pending = nil
+ $output.o( :eol ) if @count > 0
+ end
+ unless @listener then
+ case name
+ when "statements"
+ @pending = :statement
+ return true
+ else
+ raise "#{self}.tag_start(#{name}) UNHANDLED"
+ end
+ end
+ return @listener.tag_start( name, attrs )
+ end
+
+ def text( s )
+ return @listener.text( s ) if @listener
+ end
+
+ def tag_end( name )
+ debug "-- #{self}.tag_end(#{name}) @listener #{@listener}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ unless @listener then
+ @count += 1
+ @pending = :statement
+ end
+ return true
+ end
+ case name
+ when "statements"
+ return false
+ else
+ raise "#{self}.tag_end(#{name}) UNHANDLED"
+ end
+ return true # this listener has its own end tag
+ end
+end
Added: trunk/yxmlconv/src/symbols.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/src/symbols.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/src/symbols.rb (added)
+++ trunk/yxmlconv/src/symbols.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,124 @@
+#
+# symbols.rb
+#
+
+require 'helper'
+
+#------------------------------------------------
+# Parse <symbol> ... </symbol>
+#
+#
+class YSymbol
+ def symbolhash h
+ case h["category"]
+ when "filename"
+ "Filename #{h['name']}"
+ when "variable"
+ "#{h['type']} #{h['name']}"
+ when "module"
+ "Module #{h['name']}"
+ when "function"
+ "#{h['type']} #{h['name']}"
+ else
+ "Unhandled category #{h['category']}"
+ end
+ end
+
+ def initialize kind = nil
+ @kind = kind # :module, :definition, :declaration
+ end
+
+ def tag_start( name, attrs )
+ debug "#{self}.tag_start(#{name})"
+ case name
+ when "symbol"
+ h = Helper.attrs2hash attrs
+ $output.o( { :com => symbolhash( h ) } ) if @kind == :module
+ $output.o( { :com => h["type"] << " " << h["name"] } ) if @kind == :definition || @kind == :declaration
+ $output.o( { :var => h["name"] } ) if @kind == :declaration
+ else
+ raise "#{self}.tag_start(#{name}) UNKNOWN"
+ end
+ return true
+ end
+
+ def tag_end( name )
+ debug "#{self}.tag_end(#{name})"
+ case name
+ when "symbol"
+ return false
+ else
+ raise "#{self}.tag_end(#{name}) UNKNOWN"
+ end
+ return true
+ end
+end
+
+
+#------------------------------------------------
+#
+# Symbols listener
+# Listens to tags within <symbols>...</symbols>
+# if tag_end returns false, tear down listener
+
+class Symbols
+ def initialize kind
+ debug "#{self}.new kind #{kind}"
+ @listener = nil
+ @count = 0
+ @kind = kind # :module, :definition, :declaration, see YBlock
+ @pending = nil
+ end
+
+ def tag_start( name, attrs )
+ debug "#{self.class}.tag_start(#{name}) @listener #{@listener} @count #{@count}"
+ if @pending == :symbol then
+ @listener = YSymbol.new @kind
+ @pending = nil
+ case @kind
+ when :definition, :module
+ $output.o( :com ) if @count > 0
+ when :declaration
+ $output.o( :po ) if @count == 0
+ $output.o( :sep ) if @count > 0
+ end
+ end
+ unless @listener then
+ case name
+ when "symbols"
+ @pending = :symbol
+ return true
+ else
+ if @kind == :definition # dont accept, symbols is optional
+ return false
+ end
+ raise "#{self}.tag_start(#{name}) UNHANDLED"
+ end
+ end
+ return @listener.tag_start( name, attrs )
+ end
+
+ def tag_end( name )
+ debug "#{self.class}.tag_end(#{name}) @listener #{@listener} @kind #{@kind}"
+ if (@listener) then
+ @listener = nil unless @listener.tag_end( name )
+ unless @listener then
+ @count += 1
+ @pending = :symbol
+ end
+ return true
+ end
+ case name
+ when "symbols"
+ if @kind == :declaration
+ $output.o( :pc )
+ $output.o( :eol )
+ end
+ $output.o( { :com => "Symbols done" } )
+ return false
+ else
+ raise "#{self}.tag_end(#{name}) UNHANDLED"
+ end
+ return true # this listener has its own end tag
+ end
+end
Added: trunk/yxmlconv/tests/Makefile
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/Makefile?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/Makefile (added)
+++ trunk/yxmlconv/tests/Makefile Mon Jul 16 12:46:10 2007
@@ -0,0 +1,33 @@
+#
+# Makefile for ycpxml2ruby/tests
+#
+
+check: all
+
+all:
+ ruby void.rb
+ ruby boolean.rb
+ ruby integer.rb
+ ruby float.rb
+ ruby string.rb
+ ruby path.rb
+ ruby symbol.rb
+# ruby term.rb
+ ruby list.rb
+ ruby map.rb
+
+ ruby builtin_boolean.rb
+ ruby builtin_integer.rb
+ ruby builtin_float.rb
+ ruby builtin_string.rb
+
+ ruby variable.rb
+ ruby if.rb
+ ruby bracket_assign.rb
+ ruby compare.rb
+ ruby yebracket.rb
+ ruby triple.rb
+
+ ruby while.rb
+ ruby repeat.rb
+ ruby do.rb
Added: trunk/yxmlconv/tests/boolean.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/boolean.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/boolean.rb (added)
+++ trunk/yxmlconv/tests/boolean.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,13 @@
+#
+# boolean.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class BooleanTest < Test::Unit::TestCase
+ def test_converter
+ assert converter_test( "boolean.xml" ) == "return true"
+ end
+end
Added: trunk/yxmlconv/tests/bracket_assign.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/bracket_assign.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/bracket_assign.rb (added)
+++ trunk/yxmlconv/tests/bracket_assign.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,21 @@
+#
+# bracket_assign.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class BracketAssignTest < Test::Unit::TestCase
+ def test_converter
+ result = converter_test( "bracket_assign.xml" )
+ expected = [
+'m = { }',
+'m[ 1 ] = 1' ]
+ i = 0
+ result.split("\n").each{ |l|
+ assert l == expected[i]
+ i += 1
+ }
+ end
+end
Added: trunk/yxmlconv/tests/builtin_boolean.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/builtin_boolean.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/builtin_boolean.rb (added)
+++ trunk/yxmlconv/tests/builtin_boolean.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,23 @@
+#
+# builtin_boolean.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class BuiltinBooleanTest < Test::Unit::TestCase
+ def test_converter
+ result = converter_test( "builtin_boolean.xml" )
+ expected = [
+"return ( true && false )",
+"return ( false || true )",
+"return !( false && false )",
+"return !( ( false && ( false || true ) ) || !( true && false ) )" ]
+ i = 0
+ result.split("\n").each{ |l|
+ assert l == expected[i]
+ i += 1
+ }
+ end
+end
Added: trunk/yxmlconv/tests/builtin_float.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/builtin_float.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/builtin_float.rb (added)
+++ trunk/yxmlconv/tests/builtin_float.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,36 @@
+#
+# builtin_float.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class BuiltinFloatTest < Test::Unit::TestCase
+ def test_converter
+ result = converter_test( "builtin_float.xml" )
+ expected = [
+'return ( 1.42 + 1.42 )',
+'return ( 1.42 - 1.42 )',
+'return -1.42',
+'return ( 1.42 * 1.42 )',
+'return ( 1.42 / 1.42 )',
+'return Ycp::Builtin::tofloat( "1.42" )' ]
+ i = 0
+ result.split("\n").each{ |l|
+ assert l == expected[i]
+ i += 1
+ }
+ end
+
+ def test_converter1
+ result = converter_test( "builtin_float1.xml" )
+ expected = [
+"return Ycp::Builtin::tostring( 1.42, 2 )" ]
+ i = 0
+ result.split("\n").each{ |l|
+ assert l == expected[i]
+ i += 1
+ }
+ end
+end
Added: trunk/yxmlconv/tests/builtin_integer.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/builtin_integer.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/builtin_integer.rb (added)
+++ trunk/yxmlconv/tests/builtin_integer.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,32 @@
+#
+# builtin_integer.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class BuiltinIntegerTest < Test::Unit::TestCase
+ def test_converter
+ result = converter_test( "builtin_integer.xml" )
+ expected = [
+'return ( 1 + 1 )',
+'return ( 1 - 1 )',
+'return -42',
+'return ( 1 * 1 )',
+'return ( 1 / 1 )',
+'return ( 1 % 1 )',
+'return ( 1 & 1 )',
+'return ( 1 ^ 1 )',
+'return ( 1 | 1 )',
+'return ( 1 << 1 )',
+'return ( 1 >> 1 )',
+'return ~1',
+'return Ycp::Builtin::tointeger( "1" )' ]
+ i = 0
+ result.split("\n").each{ |l|
+ assert l == expected[i]
+ i += 1
+ }
+ end
+end
Added: trunk/yxmlconv/tests/builtin_string.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/builtin_string.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/builtin_string.rb (added)
+++ trunk/yxmlconv/tests/builtin_string.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,25 @@
+#
+# builtin_string.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class BuiltinStringTest < Test::Unit::TestCase
+ def test_converter
+ result = converter_test( "builtin_string.xml" )
+ expected = [
+'return ( "a" + "b" )',
+'return ( "a" + 42 )',
+'return ( "a" + ".path" )',
+'return ( "a" + :b )',
+'return Ycp::Builtin::tostring( 3.14159 )'
+]
+ i = 0
+ result.split("\n").each{ |l|
+ assert l == expected[i]
+ i += 1
+ }
+ end
+end
Added: trunk/yxmlconv/tests/check_clients.sh
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/check_clients.sh?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/check_clients.sh (added)
+++ trunk/yxmlconv/tests/check_clients.sh Mon Jul 16 12:46:10 2007
@@ -0,0 +1,328 @@
+ruby convert.rb --check tests/clients/add-on_auto.xml
+ruby convert.rb --check tests/clients/add-on_proposal.xml
+ruby convert.rb --check tests/clients/add-on.xml
+ruby convert.rb --check tests/clients/autoinst_scripts1_finish.xml
+ruby convert.rb --check tests/clients/autoinst_scripts2_finish.xml
+ruby convert.rb --check tests/clients/autoinst_test_clone.xml
+ruby convert.rb --check tests/clients/autoinst_test_stage.xml
+ruby convert.rb --check tests/clients/autoyast.xml
+ruby convert.rb --check tests/clients/ayast_probe.xml
+# ruby convert.rb --check tests/clients/backup_available_packages.xml
+# ruby convert.rb --check tests/clients/backup_get_packages.xml
+# ruby convert.rb --check tests/clients/backup_proposal.xml
+# ruby convert.rb --check tests/clients/backup_save_profile.xml
+# ruby convert.rb --check tests/clients/backup.xml
+# ruby convert.rb --check tests/clients/bluetooth_auto.xml
+# ruby convert.rb --check tests/clients/bluetooth_proposal.xml
+# ruby convert.rb --check tests/clients/bluetooth.xml
+# ruby convert.rb --check tests/clients/bootfloppy.xml
+# ruby convert.rb --check tests/clients/bootloader_auto.xml
+# ruby convert.rb --check tests/clients/bootloader_finish.xml
+# ruby convert.rb --check tests/clients/bootloader_proposal.xml
+# ruby convert.rb --check tests/clients/bootloader.xml
+# ruby convert.rb --check tests/clients/checkmedia.xml
+# ruby convert.rb --check tests/clients/classes_auto.xml
+# ruby convert.rb --check tests/clients/clone_system.xml
+# ruby convert.rb --check tests/clients/controller.xml
+# ruby convert.rb --check tests/clients/copy_files_finish.xml
+# ruby convert.rb --check tests/clients/copy_logs_finish.xml
+# ruby convert.rb --check tests/clients/copy_systemfiles_finish.xml
+# ruby convert.rb --check tests/clients/country_simple_proposal.xml
+# ruby convert.rb --check tests/clients/create_udev_cdrom.xml
+# ruby convert.rb --check tests/clients/desktop_finish.xml
+# ruby convert.rb --check tests/clients/dhcp-server_auto.xml
+# ruby convert.rb --check tests/clients/dhcp-server.xml
+# ruby convert.rb --check tests/clients/dirinstall_options_proposal.xml
+# ruby convert.rb --check tests/clients/dirinstall_options.xml
+# ruby convert.rb --check tests/clients/dirinstall.xml
+# ruby convert.rb --check tests/clients/disk.xml
+# ruby convert.rb --check tests/clients/dns_auto.xml
+# ruby convert.rb --check tests/clients/dns-server_auto.xml
+# ruby convert.rb --check tests/clients/dns-server.xml
+# ruby convert.rb --check tests/clients/dns.xml
+# ruby convert.rb --check tests/clients/dom0_setup.xml
+# ruby convert.rb --check tests/clients/do_not_show_again_editor.xml
+# ruby convert.rb --check tests/clients/driver_update1_finish.xml
+# ruby convert.rb --check tests/clients/driver_update2_finish.xml
+# ruby convert.rb --check tests/clients/dsl_proposal.xml
+# ruby convert.rb --check tests/clients/dsl.xml
+# ruby convert.rb --check tests/clients/files_auto.xml
+# ruby convert.rb --check tests/clients/firewall_auto.xml
+# ruby convert.rb --check tests/clients/firewall_proposal.xml
+# ruby convert.rb --check tests/clients/firewall.xml
+# ruby convert.rb --check tests/clients/fonts_finish.xml
+# ruby convert.rb --check tests/clients/general_auto.xml
+# ruby convert.rb --check tests/clients/GenProf.xml
+# ruby convert.rb --check tests/clients/groups.xml
+# ruby convert.rb --check tests/clients/host_auto.xml
+# ruby convert.rb --check tests/clients/host.xml
+# ruby convert.rb --check tests/clients/hwinfo_proposal.xml
+# ruby convert.rb --check tests/clients/hwinfo.xml
+# ruby convert.rb --check tests/clients/idedma_auto.xml
+# ruby convert.rb --check tests/clients/idedma_summary.xml
+# ruby convert.rb --check tests/clients/idedma_write.xml
+# ruby convert.rb --check tests/clients/idedma.xml
+# ruby convert.rb --check tests/clients/inetd_auto.xml
+# ruby convert.rb --check tests/clients/inetd_proposal.xml
+# ruby convert.rb --check tests/clients/inetd.xml
+# ruby convert.rb --check tests/clients/inst_addon_update_sources.xml
+# ruby convert.rb --check tests/clients/inst_add-on.xml
+# ruby convert.rb --check tests/clients/installation_worker.xml
+# ruby convert.rb --check tests/clients/installation.xml
+# ruby convert.rb --check tests/clients/inst_ask_net_test.xml
+# ruby convert.rb --check tests/clients/inst_ask_online_update.xml
+# ruby convert.rb --check tests/clients/inst_auth.xml
+# ruby convert.rb --check tests/clients/inst_autoconfigure.xml
+# ruby convert.rb --check tests/clients/inst_autoimage.xml
+# ruby convert.rb --check tests/clients/inst_autoinit.xml
+# ruby convert.rb --check tests/clients/inst_autopost.xml
+# ruby convert.rb --check tests/clients/inst_autosetup.xml
+# ruby convert.rb --check tests/clients/inst_backup.xml
+# ruby convert.rb --check tests/clients/inst_checkmedia.xml
+# ruby convert.rb --check tests/clients/inst_congratulate.xml
+# ruby convert.rb --check tests/clients/inst_custom_packages.xml
+# ruby convert.rb --check tests/clients/inst_custom_part.xml
+# ruby convert.rb --check tests/clients/inst_desktop.xml
+# ruby convert.rb --check tests/clients/inst_dirinstall_finish.xml
+# ruby convert.rb --check tests/clients/inst_dirinstall.xml
+# ruby convert.rb --check tests/clients/inst_disks_activate.xml
+# ruby convert.rb --check tests/clients/inst_disk.xml
+# ruby convert.rb --check tests/clients/inst_doit.xml
+# ruby convert.rb --check tests/clients/inst_do_net_test.xml
+# ruby convert.rb --check tests/clients/inst_do_resize.xml
+# ruby convert.rb --check tests/clients/inst_evms.xml
+# ruby convert.rb --check tests/clients/inst_extrasources.xml
+# ruby convert.rb --check tests/clients/inst_fam.xml
+# ruby convert.rb --check tests/clients/inst_features.xml
+# ruby convert.rb --check tests/clients/inst_finish.xml
+# ruby convert.rb --check tests/clients/inst_hostname.xml
+# ruby convert.rb --check tests/clients/inst_hwinfo.xml
+# ruby convert.rb --check tests/clients/inst_info.xml
+# ruby convert.rb --check tests/clients/inst_iscsi-client.xml
+# ruby convert.rb --check tests/clients/inst_kickoff.xml
+# ruby convert.rb --check tests/clients/inst_language_add-on.xml
+# ruby convert.rb --check tests/clients/inst_language.xml
+# ruby convert.rb --check tests/clients/inst_license.xml
+# ruby convert.rb --check tests/clients/inst_lvm_lv.xml
+# ruby convert.rb --check tests/clients/inst_lvm_pv.xml
+# ruby convert.rb --check tests/clients/inst_mediacopy.xml
+# ruby convert.rb --check tests/clients/inst_media.xml
+# ruby convert.rb --check tests/clients/inst_mode.xml
+# ruby convert.rb --check tests/clients/inst_mouse.xml
+# ruby convert.rb --check tests/clients/inst_netprobe.xml
+# ruby convert.rb --check tests/clients/inst_netsetup.xml
+# ruby convert.rb --check tests/clients/inst_packages.xml
+# ruby convert.rb --check tests/clients/inst_part_proposal.xml
+# ruby convert.rb --check tests/clients/inst_pre_install.xml
+# ruby convert.rb --check tests/clients/inst_prepdisk.xml
+# ruby convert.rb --check tests/clients/inst_proposal.xml
+# ruby convert.rb --check tests/clients/inst_release_notes.xml
+# ruby convert.rb --check tests/clients/inst_repair.xml
+# ruby convert.rb --check tests/clients/inst_resize_ui.xml
+# ruby convert.rb --check tests/clients/inst_restore_settings.xml
+# ruby convert.rb --check tests/clients/inst_rootpart.xml
+# ruby convert.rb --check tests/clients/inst_root.xml
+# ruby convert.rb --check tests/clients/inst_rpmcopy.xml
+# ruby convert.rb --check tests/clients/inst_save_hardware_status.xml
+# ruby convert.rb --check tests/clients/inst_source.xml
+# ruby convert.rb --check tests/clients/inst_startup.xml
+# ruby convert.rb --check tests/clients/inst_suseconfig.xml
+# ruby convert.rb --check tests/clients/inst_suse_register.xml
+# ruby convert.rb --check tests/clients/inst_sw_select.xml
+# ruby convert.rb --check tests/clients/inst_system_analysis.xml
+# ruby convert.rb --check tests/clients/inst_target_part.xml
+# ruby convert.rb --check tests/clients/inst_target_selection.xml
+# ruby convert.rb --check tests/clients/inst_test_workflow.xml
+# ruby convert.rb --check tests/clients/inst_timezone.xml
+# ruby convert.rb --check tests/clients/inst_update_partition.xml
+# ruby convert.rb --check tests/clients/inst_update.xml
+# ruby convert.rb --check tests/clients/inst_user.xml
+# ruby convert.rb --check tests/clients/inst_vm_autoyast.xml
+# ruby convert.rb --check tests/clients/inst_vm_disks.xml
+# ruby convert.rb --check tests/clients/inst_vm_hardware.xml
+# ruby convert.rb --check tests/clients/inst_vm_kickoff.xml
+# ruby convert.rb --check tests/clients/inst_vm_manage.xml
+# ruby convert.rb --check tests/clients/inst_vm_network.xml
+# ruby convert.rb --check tests/clients/inst_vm_options.xml
+# ruby convert.rb --check tests/clients/inst_vm_source.xml
+# ruby convert.rb --check tests/clients/inst_welcome.xml
+# ruby convert.rb --check tests/clients/inst_x11.xml
+# ruby convert.rb --check tests/clients/inst_xen_create.xml
+# ruby convert.rb --check tests/clients/inst_xen_mode.xml
+# ruby convert.rb --check tests/clients/inst_you.xml
+# ruby convert.rb --check tests/clients/ipv6_proposal.xml
+# ruby convert.rb --check tests/clients/irc.xml
+# ruby convert.rb --check tests/clients/irda.xml
+# ruby convert.rb --check tests/clients/iscsi-client_auto.xml
+# ruby convert.rb --check tests/clients/iscsi-client_finish.xml
+# ruby convert.rb --check tests/clients/iscsi-client_proposal.xml
+# ruby convert.rb --check tests/clients/iscsi-client.xml
+# ruby convert.rb --check tests/clients/isdn_proposal.xml
+# ruby convert.rb --check tests/clients/isdn.xml
+# ruby convert.rb --check tests/clients/joystick.xml
+# ruby convert.rb --check tests/clients/kerberos-client_auto.xml
+# ruby convert.rb --check tests/clients/kerberos-client.xml
+# ruby convert.rb --check tests/clients/kerberos.xml
+# ruby convert.rb --check tests/clients/kernel_finish.xml
+# ruby convert.rb --check tests/clients/keyboard_auto.xml
+# ruby convert.rb --check tests/clients/keyboard_proposal.xml
+# ruby convert.rb --check tests/clients/keyboard_simple_proposal.xml
+# ruby convert.rb --check tests/clients/keyboard.xml
+# ruby convert.rb --check tests/clients/lan_auto.xml
+# ruby convert.rb --check tests/clients/language_auto.xml
+# ruby convert.rb --check tests/clients/language_proposal.xml
+# ruby convert.rb --check tests/clients/language_simple_proposal.xml
+# ruby convert.rb --check tests/clients/language.xml
+# ruby convert.rb --check tests/clients/lan_proposal.xml
+# ruby convert.rb --check tests/clients/lan.xml
+# ruby convert.rb --check tests/clients/ldap_auto.xml
+# ruby convert.rb --check tests/clients/ldap_browser.xml
+# ruby convert.rb --check tests/clients/ldap-client.xml
+# ruby convert.rb --check tests/clients/ldap_config.xml
+# ruby convert.rb --check tests/clients/ldap.xml
+# ruby convert.rb --check tests/clients/ldconfig_finish.xml
+# ruby convert.rb --check tests/clients/LogProf.xml
+# ruby convert.rb --check tests/clients/lvm_config_ui.xml
+# ruby convert.rb --check tests/clients/lvm_config.xml
+# ruby convert.rb --check tests/clients/mail_auto.xml
+# ruby convert.rb --check tests/clients/mail.xml
+# ruby convert.rb --check tests/clients/media_proposal.xml
+# ruby convert.rb --check tests/clients/menu.xml
+# ruby convert.rb --check tests/clients/modem_proposal.xml
+# ruby convert.rb --check tests/clients/modem.xml
+# ruby convert.rb --check tests/clients/mode_proposal.xml
+# ruby convert.rb --check tests/clients/mouse_proposal.xml
+# ruby convert.rb --check tests/clients/mouse.xml
+# ruby convert.rb --check tests/clients/network_finish.xml
+# ruby convert.rb --check tests/clients/networkmanager_proposal.xml
+# ruby convert.rb --check tests/clients/network.xml
+# ruby convert.rb --check tests/clients/nfs_auto.xml
+# ruby convert.rb --check tests/clients/nfs-client.xml
+# ruby convert.rb --check tests/clients/nfs.xml
+# ruby convert.rb --check tests/clients/nis_auto.xml
+# ruby convert.rb --check tests/clients/nis-client.xml
+# ruby convert.rb --check tests/clients/nis.xml
+# ruby convert.rb --check tests/clients/ntp-client_auto.xml
+# ruby convert.rb --check tests/clients/ntp-client.xml
+# ruby convert.rb --check tests/clients/online_update_auto.xml
+# ruby convert.rb --check tests/clients/online_update_install.xml
+# ruby convert.rb --check tests/clients/online_update_select.xml
+# ruby convert.rb --check tests/clients/online_update_setup.xml
+# ruby convert.rb --check tests/clients/online_update_start.xml
+# ruby convert.rb --check tests/clients/online_update.xml
+# ruby convert.rb --check tests/clients/osr_module_list.xml
+# ruby convert.rb --check tests/clients/osr_verified_packages.xml
+# ruby convert.rb --check tests/clients/packages_proposal.xml
+# ruby convert.rb --check tests/clients/partitions_proposal.xml
+# ruby convert.rb --check tests/clients/password.xml
+# ruby convert.rb --check tests/clients/pkg_finish.xml
+# ruby convert.rb --check tests/clients/power-management_auto.xml
+# ruby convert.rb --check tests/clients/power-management.xml
+# ruby convert.rb --check tests/clients/powertweak.xml
+# ruby convert.rb --check tests/clients/pre_umount_finish.xml
+# ruby convert.rb --check tests/clients/printer_auto.xml
+# ruby convert.rb --check tests/clients/printer_proposal.xml
+# ruby convert.rb --check tests/clients/printer.xml
+# ruby convert.rb --check tests/clients/print-product.xml
+# ruby convert.rb --check tests/clients/profile_manager.xml
+# ruby convert.rb --check tests/clients/profile-manager.xml
+# ruby convert.rb --check tests/clients/provider.xml
+# ruby convert.rb --check tests/clients/proxy_auto.xml
+# ruby convert.rb --check tests/clients/proxy_finish.xml
+# ruby convert.rb --check tests/clients/proxy_proposal.xml
+# ruby convert.rb --check tests/clients/proxy.xml
+# ruby convert.rb --check tests/clients/release_notes_popup.xml
+# ruby convert.rb --check tests/clients/remotechooser.xml
+# ruby convert.rb --check tests/clients/remoteinstall.xml
+# ruby convert.rb --check tests/clients/remote_proposal.xml
+# ruby convert.rb --check tests/clients/remote.xml
+# ruby convert.rb --check tests/clients/repair.xml
+# ruby convert.rb --check tests/clients/report_auto.xml
+# ruby convert.rb --check tests/clients/restore_auto.xml
+# ruby convert.rb --check tests/clients/restore.xml
+# ruby convert.rb --check tests/clients/rootpart_proposal.xml
+# ruby convert.rb --check tests/clients/routing_auto.xml
+# ruby convert.rb --check tests/clients/routing.xml
+# ruby convert.rb --check tests/clients/runlevel_auto.xml
+# ruby convert.rb --check tests/clients/runlevel_finish.xml
+# ruby convert.rb --check tests/clients/runlevel_proposal.xml
+# ruby convert.rb --check tests/clients/runlevel.xml
+# ruby convert.rb --check tests/clients/samba-client_auto.xml
+# ruby convert.rb --check tests/clients/samba-client.xml
+# ruby convert.rb --check tests/clients/samba-server_auto.xml
+# ruby convert.rb --check tests/clients/samba-server.xml
+# ruby convert.rb --check tests/clients/save_config_finish.xml
+# ruby convert.rb --check tests/clients/save_hw_status_finish.xml
+# ruby convert.rb --check tests/clients/scanner.xml
+# ruby convert.rb --check tests/clients/scripts_auto.xml
+# ruby convert.rb --check tests/clients/SD_AddProfile.xml
+# ruby convert.rb --check tests/clients/SD_DeleteProfile.xml
+# ruby convert.rb --check tests/clients/SD_EditProfile.xml
+# ruby convert.rb --check tests/clients/SD_Report.xml
+# ruby convert.rb --check tests/clients/security_auto.xml
+# ruby convert.rb --check tests/clients/security_summary.xml
+# ruby convert.rb --check tests/clients/security.xml
+# ruby convert.rb --check tests/clients/select_language.xml
+# ruby convert.rb --check tests/clients/slp.xml
+# ruby convert.rb --check tests/clients/software_auto.xml
+# ruby convert.rb --check tests/clients/software_proposal.xml
+# ruby convert.rb --check tests/clients/software_simple_proposal.xml
+# ruby convert.rb --check tests/clients/sound_auto.xml
+# ruby convert.rb --check tests/clients/sound_proposal.xml
+# ruby convert.rb --check tests/clients/sound_summary.xml
+# ruby convert.rb --check tests/clients/sound_write.xml
+# ruby convert.rb --check tests/clients/sound.xml
+# ruby convert.rb --check tests/clients/ssh_settings_finish.xml
+# ruby convert.rb --check tests/clients/storage_auto.xml
+# ruby convert.rb --check tests/clients/storage_finish.xml
+# ruby convert.rb --check tests/clients/stroj-casu.xml
+# ruby convert.rb --check tests/clients/subdomain_no_impl.xml
+# ruby convert.rb --check tests/clients/subdomain.xml
+# ruby convert.rb --check tests/clients/sudo.xml
+# ruby convert.rb --check tests/clients/support.xml
+# ruby convert.rb --check tests/clients/suse_register_auto.xml
+# ruby convert.rb --check tests/clients/switch_scr_finish.xml
+# ruby convert.rb --check tests/clients/sw_single.xml
+# ruby convert.rb --check tests/clients/sysconfig_auto.xml
+# ruby convert.rb --check tests/clients/sysconfig.xml
+# ruby convert.rb --check tests/clients/system_settings_finish.xml
+# ruby convert.rb --check tests/clients/system_settings.xml
+# ruby convert.rb --check tests/clients/test_inst_client.xml
+# ruby convert.rb --check tests/clients/test_proposal.xml
+# ruby convert.rb --check tests/clients/timezone_auto.xml
+# ruby convert.rb --check tests/clients/timezone_proposal.xml
+# ruby convert.rb --check tests/clients/timezone.xml
+# ruby convert.rb --check tests/clients/tv_auto.xml
+# ruby convert.rb --check tests/clients/tv_proposal.xml
+# ruby convert.rb --check tests/clients/tv_write.xml
+# ruby convert.rb --check tests/clients/tv.xml
+# ruby convert.rb --check tests/clients/umount_finish.xml
+# ruby convert.rb --check tests/clients/update_proposal.xml
+# ruby convert.rb --check tests/clients/update.xml
+# ruby convert.rb --check tests/clients/users_auto.xml
+# ruby convert.rb --check tests/clients/users_plugin_ldap_all.xml
+# ruby convert.rb --check tests/clients/users_plugin_samba_groups.xml
+# ruby convert.rb --check tests/clients/users_plugin_samba.xml
+# ruby convert.rb --check tests/clients/users.xml
+# ruby convert.rb --check tests/clients/vendor.xml
+# ruby convert.rb --check tests/clients/view_anymsg.xml
+# ruby convert.rb --check tests/clients/vm_autoyast_proposal.xml
+# ruby convert.rb --check tests/clients/vm_disks_proposal.xml
+# ruby convert.rb --check tests/clients/vm_finish.xml
+# ruby convert.rb --check tests/clients/vm_hardware_proposal.xml
+# ruby convert.rb --check tests/clients/vm_helps_proposal.xml
+# ruby convert.rb --check tests/clients/vm_network_proposal.xml
+# ruby convert.rb --check tests/clients/vm_options_proposal.xml
+# ruby convert.rb --check tests/clients/vm_source_proposal.xml
+# ruby convert.rb --check tests/clients/x11_auto.xml
+# ruby convert.rb --check tests/clients/x11_finish.xml
+# ruby convert.rb --check tests/clients/x11_proposal.xml
+# ruby convert.rb --check tests/clients/x11.xml
+# ruby convert.rb --check tests/clients/xen_auto.xml
+# ruby convert.rb --check tests/clients/xen_mode_proposal.xml
+# ruby convert.rb --check tests/clients/xen.xml
+# ruby convert.rb --check tests/clients/xinetd.xml
+# ruby convert.rb --check tests/clients/XMain.xml
+# ruby convert.rb --check tests/clients/yast_inf_finish.xml
+#
+#
Added: trunk/yxmlconv/tests/compare.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/compare.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/compare.rb (added)
+++ trunk/yxmlconv/tests/compare.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,46 @@
+#
+# compare.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class CompareTest < Test::Unit::TestCase
+ def test_converter
+ result = converter_test( "compare.xml" )
+ expected = [
+'i = 42',
+'j = 0',
+'if( i == j ) then',
+' return false',
+'else',
+' if( i > j ) then',
+' return true',
+' else',
+' if( i >= j ) then',
+' return true',
+' else',
+' if( i < j ) then',
+' return false',
+' else',
+' if( i <= j ) then',
+' return false',
+' else',
+' if( i != j ) then',
+' return true',
+' else',
+' return false',
+' end',
+' end',
+' end',
+' end',
+' end',
+'end']
+ i = 0
+ result.split("\n").each{ |l|
+ assert l == expected[i]
+ i += 1
+ }
+ end
+end
Added: trunk/yxmlconv/tests/converter_test.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/converter_test.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/converter_test.rb (added)
+++ trunk/yxmlconv/tests/converter_test.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,16 @@
+#
+# ycpxml2ruby/tests/converter_test.rb
+#
+# sets output to string and calls XML Listener
+#
+
+def converter_test( filename )
+ output = ""
+
+ REXML::Document.parse_stream( File.new( "xml/" + filename ), YcpListener.new( output, [ :no_comments ] ) )
+
+ return output
+
+end
+
+
Added: trunk/yxmlconv/tests/create_clients.sh
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/create_clients.sh?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/create_clients.sh (added)
+++ trunk/yxmlconv/tests/create_clients.sh Mon Jul 16 12:46:10 2007
@@ -0,0 +1,326 @@
+( name=add-on_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=add-on_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=add-on; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=autoinst_scripts1_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=autoinst_scripts2_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=autoinst_test_clone; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=autoinst_test_stage; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=autoyast; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=ayast_probe; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=backup_available_packages; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=backup_get_packages; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=backup_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=backup_save_profile; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=backup; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=bluetooth_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=bluetooth_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=bluetooth; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=bootfloppy; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=bootloader_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=bootloader_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=bootloader_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=bootloader; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=checkmedia; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=classes_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=clone_system; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=controller; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=copy_files_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=copy_logs_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=copy_systemfiles_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=country_simple_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=create_udev_cdrom; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=desktop_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=dhcp-server_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=dhcp-server; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=dirinstall_options_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=dirinstall_options; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=dirinstall; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=disk; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=dns_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=dns-server_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=dns-server; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=dns; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=dom0_setup; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=do_not_show_again_editor; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=driver_update1_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=driver_update2_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=dsl_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=dsl; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=files_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=firewall_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=firewall_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=firewall; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=fonts_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=general_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=GenProf; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=groups; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=host_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=host; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=hwinfo_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=hwinfo; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=idedma_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=idedma_summary; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=idedma_write; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=idedma; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inetd_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inetd_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inetd; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_addon_update_sources; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_add-on; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=installation_worker; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=installation; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_ask_net_test; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_ask_online_update; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_auth; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_autoconfigure; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_autoimage; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_autoinit; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_autopost; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_autosetup; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_backup; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_checkmedia; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_congratulate; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_custom_packages; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_custom_part; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_desktop; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_dirinstall_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_dirinstall; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_disks_activate; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_disk; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_doit; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_do_net_test; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_do_resize; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_evms; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_extrasources; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_fam; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_features; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_hostname; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_hwinfo; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_info; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_iscsi-client; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_kickoff; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_language_add-on; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_language; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_license; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_lvm_lv; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_lvm_pv; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_mediacopy; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_media; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_mode; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_mouse; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_netprobe; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_netsetup; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_packages; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_part_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_pre_install; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_prepdisk; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_release_notes; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_repair; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_resize_ui; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_restore_settings; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_rootpart; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_root; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_rpmcopy; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_save_hardware_status; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_source; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_startup; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_suseconfig; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_suse_register; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_sw_select; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_system_analysis; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_target_part; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_target_selection; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_test_workflow; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_timezone; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_update_partition; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_update; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_user; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_vm_autoyast; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_vm_disks; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_vm_hardware; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_vm_kickoff; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_vm_manage; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_vm_network; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_vm_options; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_vm_source; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_welcome; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_x11; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_xen_create; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_xen_mode; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=inst_you; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=ipv6_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=irc; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=irda; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=iscsi-client_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=iscsi-client_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=iscsi-client_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=iscsi-client; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=isdn_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=isdn; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=joystick; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=kerberos-client_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=kerberos-client; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=kerberos; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=kernel_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=keyboard_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=keyboard_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=keyboard_simple_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=keyboard; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=lan_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=language_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=language_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=language_simple_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=language; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=lan_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=lan; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=ldap_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=ldap_browser; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=ldap-client; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=ldap_config; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=ldap; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=ldconfig_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=LogProf; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=lvm_config_ui; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=lvm_config; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=mail_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=mail; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=media_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=menu; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=modem_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=modem; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=mode_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=mouse_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=mouse; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=network_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=networkmanager_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=network; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=nfs_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=nfs-client; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=nfs; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=nis_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=nis-client; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=nis; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=ntp-client_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=ntp-client; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=online_update_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=online_update_install; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=online_update_select; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=online_update_setup; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=online_update_start; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=online_update; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=osr_module_list; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=osr_verified_packages; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=packages_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=partitions_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=password; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=pkg_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=power-management_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=power-management; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=powertweak; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=pre_umount_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=printer_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=printer_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=printer; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=print-product; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=profile_manager; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=profile-manager; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=provider; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=proxy_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=proxy_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=proxy_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=proxy; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=release_notes_popup; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=remotechooser; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=remoteinstall; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=remote_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=remote; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=repair; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=report_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=restore_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=restore; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=rootpart_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=routing_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=routing; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=runlevel_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=runlevel_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=runlevel_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=runlevel; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=samba-client_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=samba-client; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=samba-server_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=samba-server; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=save_config_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=save_hw_status_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=scanner; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=scripts_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=SD_AddProfile; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=SD_DeleteProfile; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=SD_EditProfile; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=SD_Report; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=security_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=security_summary; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=security; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=select_language; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=slp; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=software_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=software_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=software_simple_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=sound_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=sound_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=sound_summary; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=sound_write; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=sound; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=ssh_settings_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=storage_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=storage_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=stroj-casu; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=subdomain_no_impl; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=subdomain; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=sudo; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=support; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=suse_register_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=switch_scr_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=sw_single; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=sysconfig_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=sysconfig; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=system_settings_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=system_settings; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=test_inst_client; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=test_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=timezone_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=timezone_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=timezone; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=tv_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=tv_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=tv_write; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=tv; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=umount_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=update_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=update; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=users_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=users_plugin_ldap_all; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=users_plugin_samba_groups; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=users_plugin_samba; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=users; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=vendor; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=view_anymsg; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=vm_autoyast_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=vm_disks_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=vm_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=vm_hardware_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=vm_helps_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=vm_network_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=vm_options_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=vm_source_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=x11_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=x11_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=x11_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=x11; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=xen_auto; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=xen_mode_proposal; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=xen; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=xinetd; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=XMain; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
+( name=yast_inf_finish; ycpc -c -x /usr/share/YaST2/clients/$name.ycp -o clients/$name.xml)
Added: trunk/yxmlconv/tests/do.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/do.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/do.rb (added)
+++ trunk/yxmlconv/tests/do.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,23 @@
+#
+# do.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class DoTest < Test::Unit::TestCase
+ def test_converter
+ result = converter_test( "do.xml" )
+ expected = [
+'loop do',
+' return false',
+' break unless( false )',
+'end' ]
+ i = 0
+ result.split("\n").each{ |l|
+ assert l == expected[i]
+ i += 1
+ }
+ end
+end
Added: trunk/yxmlconv/tests/float.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/float.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/float.rb (added)
+++ trunk/yxmlconv/tests/float.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,13 @@
+#
+# float.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class FloatTest < Test::Unit::TestCase
+ def test_converter
+ assert converter_test( "float.xml" ) == "return 42.42"
+ end
+end
Added: trunk/yxmlconv/tests/if.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/if.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/if.rb (added)
+++ trunk/yxmlconv/tests/if.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,76 @@
+#
+# if.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class IfTest < Test::Unit::TestCase
+ def test_if
+ result = converter_test( "if.xml" )
+ expected = [
+'if( true ) then',
+' return false',
+'end' ]
+ i = 0
+ result.split("\n").each{ |l|
+ assert l == expected[i]
+ i += 1
+ }
+ end
+ def test_if1
+ result = converter_test( "if1.xml" )
+ expected = [
+'if( true ) then',
+' return false',
+'else',
+' return true',
+'end' ]
+ i = 0
+ result.split("\n").each{ |l|
+ assert l == expected[i]
+ i += 1
+ }
+ end
+ def test_if2
+ result = converter_test( "if2.xml" )
+ expected = [
+'if( true ) then',
+' return false',
+'else',
+' return true',
+'end' ]
+ i = 0
+ result.split("\n").each{ |l|
+ assert l == expected[i]
+ i += 1
+ }
+ end
+ def test_if3
+ result = converter_test( "if3.xml" )
+ expected = [
+'if( 0 == 1 ) then',
+' return 1',
+'else',
+' if( 0 == 2 ) then',
+' return 2',
+' else',
+' if( 0 == 3 ) then',
+' return 3',
+' else',
+' if( 0 == 4 ) then',
+' return 4',
+' else',
+' return 0',
+' end',
+' end',
+' end',
+'end']
+ i = 0
+ result.split("\n").each{ |l|
+ assert l == expected[i]
+ i += 1
+ }
+ end
+end
Added: trunk/yxmlconv/tests/integer.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/integer.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/integer.rb (added)
+++ trunk/yxmlconv/tests/integer.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,13 @@
+#
+# integer.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class IntegerTest < Test::Unit::TestCase
+ def test_converter
+ assert converter_test( "integer.xml" ) == "return 42"
+ end
+end
Added: trunk/yxmlconv/tests/list.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/list.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/list.rb (added)
+++ trunk/yxmlconv/tests/list.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,34 @@
+#
+# list.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class ListTest < Test::Unit::TestCase
+ def test_converter
+ assert converter_test( "list.xml" ) == "return [ ]"
+ assert converter_test( "list1.xml" ) == "return [ 1 ]"
+ assert converter_test( "list2.xml" ) == "return [ 1, 2 ]"
+ assert converter_test( "list3.xml" ) == "return [ 1, 2, 3 ]"
+ assert converter_test( "listlist.xml" ) == "return [ 1, 2, [ 3, [ 4 ] ] ]"
+ end
+
+ def test_nested
+ expected = [
+'return [ ',
+' { 1 => true }, ',
+' { 2 => false, 3 => :three }, ',
+' { }, ',
+' { ',
+' 1 => 1, ',
+' 2 => 2, ',
+' 3 => 3, ',
+' 4 => 4',
+' }',
+' ]'].join "\n"
+ assert converter_test( "listmap.xml" ) == expected
+ end
+
+end
Added: trunk/yxmlconv/tests/locale.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/locale.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/locale.rb (added)
+++ trunk/yxmlconv/tests/locale.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,32 @@
+#
+# locale.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class LocaleTest < Test::Unit::TestCase
+ def test_locale
+ result = converter_test( "locale.xml" )
+ expected = [
+'Ycp::textdomain "en"',
+'return _("<p>\'English\'&"Deutsch"</p>")' ]
+ i = 0
+ result.split("\n").each{ |l|
+ assert l == expected[i]
+ i += 1
+ }
+ end
+ def test_locale1
+ result = converter_test( "locale1.xml" )
+ expected = [
+'Ycp::textdomain "de"',
+'return _("foo", "bar", 42)' ]
+ i = 0
+ result.split("\n").each{ |l|
+ assert l == expected[i]
+ i += 1
+ }
+ end
+end
Added: trunk/yxmlconv/tests/map.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/map.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/map.rb (added)
+++ trunk/yxmlconv/tests/map.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,37 @@
+#
+# map.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class MapTest < Test::Unit::TestCase
+ def test_converter
+ assert converter_test( "map.xml" ) == 'return { }'
+ assert converter_test( "map1.xml" ) == 'return { 1 => "one" }'
+ assert converter_test( "map2.xml" ) == 'return { 1 => "one", 2 => "two" }'
+ assert converter_test( "map3.xml" ) == 'return { 1 => "one", "three" => 3, :zwei => "two" }'
+ assert converter_test( "mapmap.xml" ) == 'return { 1 => { :eins => "one" }, 2 => { } }'
+ end
+
+ def test_nested
+ expected = [
+'return { ',
+' 1 => [ { } ], ',
+' 2 => [ :two, { 3 => "three" } ], ',
+' 3 => [ :three, { 4 => "four" }, { 5 => "fize" } ], ',
+' 4 => [ ',
+' :four, ',
+' { 5 => "five" }, ',
+' { 6 => "six" }, ',
+' { 7 => "seven" }',
+' ]',
+' }'].join( "\n" )
+ assert converter_test( "maplist.xml" ) == expected
+ end
+
+# def test_yemap
+# assert converter_test( "map4.xml" ) == 'Ycp::textdomain "en"\ncmdline = {"id" => "language", "help" => _("Language configuration"), "guihandler" => nil, "initialize" => nil, "finish" => nil, "actions" => {"summary" => {"handler" => nil, "help" => _("Language configuration summary")}, "set" => {"handler" => nil, "help" => _("Set new values for language")}, "list" => {"handler" => nil, "help" => _("List all available languages.")}}, "options" => {"lang" => {"help" => _("New language value"), "type" => "string"}, "languages" => {"help" => _("List of secondary languages (separated by commas)"), "type" => "string"}}, "mappings" => {"list" => [], "set" => ["lang", "languages"], "summary" => []}}'
+# end
+end
Added: trunk/yxmlconv/tests/path.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/path.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/path.rb (added)
+++ trunk/yxmlconv/tests/path.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,13 @@
+#
+# path.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class PathTest < Test::Unit::TestCase
+ def test_converter
+ assert converter_test( "path.xml" ) == 'return ".a.path"'
+ end
+end
Added: trunk/yxmlconv/tests/repeat.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/repeat.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/repeat.rb (added)
+++ trunk/yxmlconv/tests/repeat.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,23 @@
+#
+# repeat.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class RepeatTest < Test::Unit::TestCase
+ def test_converter
+ result = converter_test( "repeat.xml" )
+ expected = [
+'repeat begin',
+' return false',
+'end',
+'until( false )' ]
+ i = 0
+ result.split("\n").each{ |l|
+ assert l == expected[i]
+ i += 1
+ }
+ end
+end
Added: trunk/yxmlconv/tests/string.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/string.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/string.rb (added)
+++ trunk/yxmlconv/tests/string.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,13 @@
+#
+# string.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class StringTest < Test::Unit::TestCase
+ def test_converter
+ assert converter_test( "string.xml" ) == 'return "string"'
+ end
+end
Added: trunk/yxmlconv/tests/symbol.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/symbol.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/symbol.rb (added)
+++ trunk/yxmlconv/tests/symbol.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,13 @@
+#
+# symbol.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class SymbolTest < Test::Unit::TestCase
+ def test_converter
+ assert converter_test( "symbol.xml" ) == "return :symbol"
+ end
+end
Added: trunk/yxmlconv/tests/term.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/term.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/term.rb (added)
+++ trunk/yxmlconv/tests/term.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,14 @@
+#
+# term.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class TermTest < Test::Unit::TestCase
+ def test_converter
+ assert converter_test( "term.xml" ) == 'return term( )'
+ assert converter_test( "term1.xml" ) == 'return term( 1, false, "true" )'
+ end
+end
Added: trunk/yxmlconv/tests/triple.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/triple.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/triple.rb (added)
+++ trunk/yxmlconv/tests/triple.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,13 @@
+#
+# triple.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class TripleTest < Test::Unit::TestCase
+ def test_converter
+ assert converter_test( "triple.xml" ) == "return ( 1 + 1 ) == 2 ? true : false"
+ end
+end
Added: trunk/yxmlconv/tests/variable.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/variable.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/variable.rb (added)
+++ trunk/yxmlconv/tests/variable.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,13 @@
+#
+# variable.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class VariableTest < Test::Unit::TestCase
+ def test_converter
+ assert converter_test( "variable.xml" ) == "i = 1"
+ end
+end
Added: trunk/yxmlconv/tests/void.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/void.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/void.rb (added)
+++ trunk/yxmlconv/tests/void.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,14 @@
+#
+# void.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class VoidTest < Test::Unit::TestCase
+ def test_converter
+ assert converter_test( "void.xml" ) == "return"
+ assert converter_test( "void1.xml" ) == "return nil"
+ end
+end
Added: trunk/yxmlconv/tests/while.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/while.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/while.rb (added)
+++ trunk/yxmlconv/tests/while.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,34 @@
+#
+# while.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class WhileTest < Test::Unit::TestCase
+ def test_converter
+ result = converter_test( "while.xml" )
+ expected = [
+'while( true )',
+' return false',
+'end' ]
+ i = 0
+ result.split("\n").each{ |l|
+ assert l == expected[i]
+ i += 1
+ }
+ end
+ def test_converter1
+ result = converter_test( "while1.xml" )
+ expected = [
+'while( true )',
+' return false',
+'end' ]
+ i = 0
+ result.split("\n").each{ |l|
+ assert l == expected[i]
+ i += 1
+ }
+ end
+end
Added: trunk/yxmlconv/tests/xml/boolean.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/boolean.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/boolean.xml (added)
+++ trunk/yxmlconv/tests/xml/boolean.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="boolean.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><const type="bool" value="true"/></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/boolean.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/boolean.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/boolean.ycp (added)
+++ trunk/yxmlconv/tests/xml/boolean.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return true;
+}
Added: trunk/yxmlconv/tests/xml/bracket_assign.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/bracket_assign.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/bracket_assign.xml (added)
+++ trunk/yxmlconv/tests/xml/bracket_assign.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="bracket_assign.ycp"/>
+ <symbol category="variable" type="map" name="m"/>
+ </symbols>
+ <statements>
+ <stmt><assign name="m"><map size="0"></map></assign></stmt>
+ <stmt><bracket><lhs><entry pos="1" name="m"/><arg><list size="1"><element><const type="int" value="1"/></element></list></arg></lhs><rhs><const type="int" value="1"/></rhs></bracket></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/bracket_assign.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/bracket_assign.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/bracket_assign.ycp (added)
+++ trunk/yxmlconv/tests/xml/bracket_assign.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,4 @@
+{
+ map m = $[];
+ m[1] = 1;
+}
Added: trunk/yxmlconv/tests/xml/builtin_boolean.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/builtin_boolean.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/builtin_boolean.xml (added)
+++ trunk/yxmlconv/tests/xml/builtin_boolean.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="builtin_boolean.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><yebinary name="&&" type="function"><const type="bool" value="true"/><const type="bool" value="false"/></yebinary></return></stmt>
+ <stmt><return><yebinary name="||" type="function"><const type="bool" value="false"/><const type="bool" value="true"/></yebinary></return></stmt>
+ <stmt><return><yeunary name="!" type="function"><yebinary name="&&" type="function"><const type="bool" value="false"/><const type="bool" value="false"/></yebinary></yeunary></return></stmt>
+ <stmt><return><yeunary name="!" type="function"><yebinary name="||" type="function"><yebinary name="&&" type="function"><const type="bool" value="false"/><yebinary name="||" type="function"><const type="bool" value="false"/><const type="bool" value="true"/></yebinary></yebinary><yeunary name="!" type="function"><yebinary name="&&" type="function"><const type="bool" value="true"/><const type="bool" value="false"/></yebinary></yeunary></yebinary></yeunary></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/builtin_boolean.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/builtin_boolean.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/builtin_boolean.ycp (added)
+++ trunk/yxmlconv/tests/xml/builtin_boolean.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,6 @@
+{
+ return (true && false);
+ return (false || true);
+ return (! (false && false));
+ return (! (false && (false || true) || !(true && false) ) );
+}
Added: trunk/yxmlconv/tests/xml/builtin_float.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/builtin_float.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/builtin_float.xml (added)
+++ trunk/yxmlconv/tests/xml/builtin_float.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="builtin_float.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><yebinary name="+" type="function"><const type="float" value="1.42"/><const type="float" value="1.42"/></yebinary></return></stmt>
+ <stmt><return><yebinary name="-" type="function"><const type="float" value="1.42"/><const type="float" value="1.42"/></yebinary></return></stmt>
+ <stmt><return><const type="float" value="-1.42"/></return></stmt>
+ <stmt><return><yebinary name="*" type="function"><const type="float" value="1.42"/><const type="float" value="1.42"/></yebinary></return></stmt>
+ <stmt><return><yebinary name="/" type="function"><const type="float" value="1.42"/><const type="float" value="1.42"/></yebinary></return></stmt>
+ <stmt><return><builtin name="tofloat" args="1"><element><const type="string" value="1.42"/></element></builtin></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/builtin_float.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/builtin_float.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/builtin_float.ycp (added)
+++ trunk/yxmlconv/tests/xml/builtin_float.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,8 @@
+{
+ return 1.42+1.42;
+ return 1.42-1.42;
+ return -1.42;
+ return 1.42*1.42;
+ return 1.42/1.42;
+ return tofloat("1.42");
+}
Added: trunk/yxmlconv/tests/xml/builtin_float1.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/builtin_float1.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/builtin_float1.xml (added)
+++ trunk/yxmlconv/tests/xml/builtin_float1.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="builtin_float1.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><builtin name="tostring" args="2"><element><const type="float" value="1.42"/></element><element><const type="int" value="2"/></element></builtin></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/builtin_float1.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/builtin_float1.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/builtin_float1.ycp (added)
+++ trunk/yxmlconv/tests/xml/builtin_float1.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return tostring( 1.42, 2 );
+}
Added: trunk/yxmlconv/tests/xml/builtin_integer.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/builtin_integer.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/builtin_integer.xml (added)
+++ trunk/yxmlconv/tests/xml/builtin_integer.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="builtin_integer.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><yebinary name="+" type="function"><const type="int" value="1"/><const type="int" value="1"/></yebinary></return></stmt>
+ <stmt><return><yebinary name="-" type="function"><const type="int" value="1"/><const type="int" value="1"/></yebinary></return></stmt>
+ <stmt><return><const type="int" value="-42"/></return></stmt>
+ <stmt><return><yebinary name="*" type="function"><const type="int" value="1"/><const type="int" value="1"/></yebinary></return></stmt>
+ <stmt><return><yebinary name="/" type="function"><const type="int" value="1"/><const type="int" value="1"/></yebinary></return></stmt>
+ <stmt><return><yebinary name="%" type="function"><const type="int" value="1"/><const type="int" value="1"/></yebinary></return></stmt>
+ <stmt><return><yebinary name="&" type="function"><const type="int" value="1"/><const type="int" value="1"/></yebinary></return></stmt>
+ <stmt><return><yebinary name="^" type="function"><const type="int" value="1"/><const type="int" value="1"/></yebinary></return></stmt>
+ <stmt><return><yebinary name="|" type="function"><const type="int" value="1"/><const type="int" value="1"/></yebinary></return></stmt>
+ <stmt><return><yebinary name="<<" type="function"><const type="int" value="1"/><const type="int" value="1"/></yebinary></return></stmt>
+ <stmt><return><yebinary name=">>" type="function"><const type="int" value="1"/><const type="int" value="1"/></yebinary></return></stmt>
+ <stmt><return><yeunary name="~" type="function"><const type="int" value="1"/></yeunary></return></stmt>
+ <stmt><return><builtin name="tointeger" args="1"><element><const type="string" value="1"/></element></builtin></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/builtin_integer.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/builtin_integer.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/builtin_integer.ycp (added)
+++ trunk/yxmlconv/tests/xml/builtin_integer.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,15 @@
+{
+ return 1+1;
+ return 1-1;
+ return -42;
+ return 1*1;
+ return 1/1;
+ return 1%1;
+ return 1&1;
+ return 1^1;
+ return 1|1;
+ return 1<<1;
+ return 1>>1;
+ return ~1;
+ return tointeger("1");
+}
Added: trunk/yxmlconv/tests/xml/builtin_string.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/builtin_string.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/builtin_string.xml (added)
+++ trunk/yxmlconv/tests/xml/builtin_string.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="builtin_string.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><yebinary name="+" type="function"><const type="string" value="a"/><const type="string" value="b"/></yebinary></return></stmt>
+ <stmt><return><yebinary name="+" type="function"><const type="string" value="a"/><const type="int" value="42"/></yebinary></return></stmt>
+ <stmt><return><yebinary name="+" type="function"><const type="string" value="a"/><const type="path" value=".path"/></yebinary></return></stmt>
+ <stmt><return><yebinary name="+" type="function"><const type="string" value="a"/><const type="symbol" value="b"/></yebinary></return></stmt>
+ <stmt><return><builtin name="tostring" args="1"><element><const type="float" value="3.14159"/></element></builtin></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/builtin_string.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/builtin_string.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/builtin_string.ycp (added)
+++ trunk/yxmlconv/tests/xml/builtin_string.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,7 @@
+{
+ return "a" + "b";
+ return "a" + 42;
+ return "a" + .path;
+ return "a" + `b;
+ return tostring( 3.14159 );
+}
Added: trunk/yxmlconv/tests/xml/compare.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/compare.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/compare.xml (added)
+++ trunk/yxmlconv/tests/xml/compare.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="compare.ycp"/>
+ <symbol category="variable" type="integer" name="i"/>
+ <symbol category="variable" type="integer" name="j"/>
+ </symbols>
+ <statements>
+ <stmt><assign name="i"><const type="int" value="42"/></assign></stmt>
+ <stmt><assign name="j"><const type="int" value="0"/></assign></stmt>
+ <stmt><if><compare op="=="><lhs><variable name="i"/></lhs><rhs><variable name="j"/></rhs></compare>
+ <then>
+ <return><const type="bool" value="false"/></return>
+ </then>
+
+ <else>
+<if><compare op=">"><lhs><variable name="i"/></lhs><rhs><variable name="j"/></rhs></compare>
+ <then>
+ <return><const type="bool" value="true"/></return>
+ </then>
+
+ <else>
+<if><compare op=">="><lhs><variable name="i"/></lhs><rhs><variable name="j"/></rhs></compare>
+ <then>
+ <return><const type="bool" value="true"/></return>
+ </then>
+
+ <else>
+<if><compare op="<"><lhs><variable name="i"/></lhs><rhs><variable name="j"/></rhs></compare>
+ <then>
+ <return><const type="bool" value="false"/></return>
+ </then>
+
+ <else>
+<if><compare op="<="><lhs><variable name="i"/></lhs><rhs><variable name="j"/></rhs></compare>
+ <then>
+ <return><const type="bool" value="false"/></return>
+ </then>
+
+ <else>
+<if><compare op="!="><lhs><variable name="i"/></lhs><rhs><variable name="j"/></rhs></compare>
+ <then>
+ <return><const type="bool" value="true"/></return>
+ </then>
+
+ <else>
+ <return><const type="bool" value="false"/></return>
+ </else>
+ </if>
+ </else>
+ </if>
+ </else>
+ </if>
+ </else>
+ </if>
+ </else>
+ </if>
+ </else>
+</if></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/compare.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/compare.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/compare.ycp (added)
+++ trunk/yxmlconv/tests/xml/compare.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,19 @@
+{
+ integer i = 42;
+ integer j = 0;
+
+ if (i == j)
+ return false;
+ else if (i > j)
+ return true;
+ else if (i >= j)
+ return true;
+ else if (i < j)
+ return false;
+ else if (i <= j)
+ return false;
+ else if (i != j)
+ return true;
+ else
+ return false;
+}
Added: trunk/yxmlconv/tests/xml/do.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/do.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/do.xml (added)
+++ trunk/yxmlconv/tests/xml/do.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="do.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><do><block kind="unspec">
+ <statements>
+ <stmt><return><const type="bool" value="false"/></return></stmt>
+ </statements>
+</block>
+<while><const type="bool" value="false"/></while></do></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/do.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/do.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/do.ycp (added)
+++ trunk/yxmlconv/tests/xml/do.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ do { return false; } while (false);
+}
Added: trunk/yxmlconv/tests/xml/float.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/float.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/float.xml (added)
+++ trunk/yxmlconv/tests/xml/float.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="float.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><const type="float" value="42.42"/></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/float.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/float.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/float.ycp (added)
+++ trunk/yxmlconv/tests/xml/float.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return 42.42;
+}
Added: trunk/yxmlconv/tests/xml/if.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/if.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/if.xml (added)
+++ trunk/yxmlconv/tests/xml/if.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="if.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><if><const type="bool" value="true"/>
+ <then>
+ <return><const type="bool" value="false"/></return>
+ </then>
+</if></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/if.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/if.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/if.ycp (added)
+++ trunk/yxmlconv/tests/xml/if.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,4 @@
+{
+ if (true)
+ return false;
+}
Added: trunk/yxmlconv/tests/xml/if1.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/if1.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/if1.xml (added)
+++ trunk/yxmlconv/tests/xml/if1.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="if1.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><if><const type="bool" value="true"/>
+ <then>
+ <return><const type="bool" value="false"/></return>
+ </then>
+
+ <else>
+ <return><const type="bool" value="true"/></return>
+ </else>
+</if></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/if1.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/if1.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/if1.ycp (added)
+++ trunk/yxmlconv/tests/xml/if1.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,6 @@
+{
+ if (true)
+ return false;
+ else
+ return true;
+}
Added: trunk/yxmlconv/tests/xml/if2.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/if2.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/if2.xml (added)
+++ trunk/yxmlconv/tests/xml/if2.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="if2.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><if><const type="bool" value="true"/>
+ <then>
+ <block kind="stmt">
+ <statements>
+ <stmt><return><const type="bool" value="false"/></return></stmt>
+ </statements>
+ </block>
+
+ </then>
+
+ <else>
+ <block kind="stmt">
+ <statements>
+ <stmt><return><const type="bool" value="true"/></return></stmt>
+ </statements>
+ </block>
+
+ </else>
+</if></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/if2.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/if2.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/if2.ycp (added)
+++ trunk/yxmlconv/tests/xml/if2.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,8 @@
+{
+ if (true){
+ return false;
+ }
+ else {
+ return true;
+ }
+}
Added: trunk/yxmlconv/tests/xml/if3.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/if3.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/if3.xml (added)
+++ trunk/yxmlconv/tests/xml/if3.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="if3.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><if><compare op="=="><lhs><const type="int" value="0"/></lhs><rhs><const type="int" value="1"/></rhs></compare>
+ <then>
+ <return><const type="int" value="1"/></return>
+ </then>
+
+ <else>
+<if><compare op="=="><lhs><const type="int" value="0"/></lhs><rhs><const type="int" value="2"/></rhs></compare>
+ <then>
+ <return><const type="int" value="2"/></return>
+ </then>
+
+ <else>
+<if><compare op="=="><lhs><const type="int" value="0"/></lhs><rhs><const type="int" value="3"/></rhs></compare>
+ <then>
+ <return><const type="int" value="3"/></return>
+ </then>
+
+ <else>
+<if><compare op="=="><lhs><const type="int" value="0"/></lhs><rhs><const type="int" value="4"/></rhs></compare>
+ <then>
+ <return><const type="int" value="4"/></return>
+ </then>
+
+ <else>
+ <return><const type="int" value="0"/></return>
+ </else>
+ </if>
+ </else>
+ </if>
+ </else>
+ </if>
+ </else>
+</if></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/if3.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/if3.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/if3.ycp (added)
+++ trunk/yxmlconv/tests/xml/if3.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,12 @@
+{
+ if ( 0 == 1 )
+ return 1;
+ else if ( 0 == 2 )
+ return 2;
+ else if ( 0 == 3 )
+ return 3;
+ else if ( 0 == 4 )
+ return 4;
+ else
+ return 0;
+}
Added: trunk/yxmlconv/tests/xml/integer.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/integer.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/integer.xml (added)
+++ trunk/yxmlconv/tests/xml/integer.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="integer.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><const type="int" value="42"/></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/integer.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/integer.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/integer.ycp (added)
+++ trunk/yxmlconv/tests/xml/integer.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return 42;
+}
Added: trunk/yxmlconv/tests/xml/list.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/list.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/list.xml (added)
+++ trunk/yxmlconv/tests/xml/list.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="list.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><list size="0"></list></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/list.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/list.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/list.ycp (added)
+++ trunk/yxmlconv/tests/xml/list.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return [];
+}
Added: trunk/yxmlconv/tests/xml/list1.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/list1.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/list1.xml (added)
+++ trunk/yxmlconv/tests/xml/list1.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="list1.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><list size="1"><element><const type="int" value="1"/></element></list></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/list1.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/list1.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/list1.ycp (added)
+++ trunk/yxmlconv/tests/xml/list1.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return [1];
+}
Added: trunk/yxmlconv/tests/xml/list2.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/list2.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/list2.xml (added)
+++ trunk/yxmlconv/tests/xml/list2.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="list2.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><list size="2"><element><const type="int" value="1"/></element><element><const type="int" value="2"/></element></list></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/list2.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/list2.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/list2.ycp (added)
+++ trunk/yxmlconv/tests/xml/list2.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return [1,2];
+}
Added: trunk/yxmlconv/tests/xml/list3.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/list3.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/list3.xml (added)
+++ trunk/yxmlconv/tests/xml/list3.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="list3.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><list size="3"><element><const type="int" value="1"/></element><element><const type="int" value="2"/></element><element><const type="int" value="3"/></element></list></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/list3.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/list3.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/list3.ycp (added)
+++ trunk/yxmlconv/tests/xml/list3.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return [1,2,3];
+}
Added: trunk/yxmlconv/tests/xml/list4.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/list4.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/list4.xml (added)
+++ trunk/yxmlconv/tests/xml/list4.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="list4.ycp"/>
+ <symbol category="variable" type="integer" name="i"/>
+ </symbols>
+ <statements>
+ <stmt><assign name="i"><const type="int" value="42"/></assign></stmt>
+ <stmt><return><list size="4"><element><const type="int" value="1"/></element><element><const type="int" value="1"/></element><element><const type="int" value="1"/></element><element><const type="int" value="1"/></element></list></return></stmt>
+ <stmt><return><list size="4"><element><variable name="i"/></element><element><yebinary name="+" type="function"><variable name="i"/><variable name="i"/></yebinary></element><element><yebinary name="+" type="function"><yebinary name="+" type="function"><variable name="i"/><variable name="i"/></yebinary><variable name="i"/></yebinary></element><element><yebinary name="+" type="function"><yebinary name="+" type="function"><yebinary name="+" type="function"><variable name="i"/><variable name="i"/></yebinary><variable name="i"/></yebinary><variable name="i"/></yebinary></element></list></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/list4.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/list4.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/list4.ycp (added)
+++ trunk/yxmlconv/tests/xml/list4.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,5 @@
+{
+ integer i = 42;
+ return [ 1, 1, 1, 1 ];
+ return [ i, i+i, i+i+i, i+i+i+i ];
+}
Added: trunk/yxmlconv/tests/xml/listlist.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/listlist.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/listlist.xml (added)
+++ trunk/yxmlconv/tests/xml/listlist.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="listlist.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><list size="3"><element><const type="int" value="1"/></element><element><const type="int" value="2"/></element><element><list size="2"><element><const type="int" value="3"/></element><element><list size="1"><element><const type="int" value="4"/></element></list></element></list></element></list></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/listlist.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/listlist.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/listlist.ycp (added)
+++ trunk/yxmlconv/tests/xml/listlist.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return [1, 2, [3, [4]]];
+}
Added: trunk/yxmlconv/tests/xml/listmap.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/listmap.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/listmap.xml (added)
+++ trunk/yxmlconv/tests/xml/listmap.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="listmap.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><list size="4"><element><map size="1"><element><key><const type="int" value="1"/></key><value><const type="bool" value="true"/></value></element></map></element><element><map size="2"><element><key><const type="int" value="2"/></key><value><const type="bool" value="false"/></value></element><element><key><const type="int" value="3"/></key><value><const type="symbol" value="three"/></value></element></map></element><element><map size="0"></map></element><element><map size="4"><element><key><const type="int" value="1"/></key><value><const type="int" value="1"/></value></element><element><key><const type="int" value="2"/></key><value><const type="int" value="2"/></value></element><element><key><const type="int" value="3"/></key><value><const type="int" value="3"/></value></element><element><key><const type="int" value="4"/></key><value><const type="int" value="4"/></value></element></map></element></list></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/listmap.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/listmap.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/listmap.ycp (added)
+++ trunk/yxmlconv/tests/xml/listmap.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return [ $[1:true], $[2:false, 3:`three], $[], $[1:1, 2:2, 3:3, 4:4 ] ];
+}
Added: trunk/yxmlconv/tests/xml/locale.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/locale.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/locale.xml (added)
+++ trunk/yxmlconv/tests/xml/locale.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="locale.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><textdomain name="en"/></stmt>
+ <stmt><return><locale domain="en" text="<p>'English'&"Deutsch"</p>"/></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/locale.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/locale.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/locale.ycp (added)
+++ trunk/yxmlconv/tests/xml/locale.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,4 @@
+{
+ textdomain "en";
+ return _("<p>'English'&\"Deutsch\"</p>");
+}
Added: trunk/yxmlconv/tests/xml/locale1.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/locale1.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/locale1.xml (added)
+++ trunk/yxmlconv/tests/xml/locale1.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="locale1.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><textdomain name="de"/></stmt>
+ <stmt><return><locale domain="de" text="foo" plural="bar"><const type="int" value="42"/></locale></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/locale1.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/locale1.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/locale1.ycp (added)
+++ trunk/yxmlconv/tests/xml/locale1.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,4 @@
+{
+ textdomain "de";
+ return _("foo", "bar", 42);
+}
Added: trunk/yxmlconv/tests/xml/map.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/map.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/map.xml (added)
+++ trunk/yxmlconv/tests/xml/map.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="map.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><map size="0"></map></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/map.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/map.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/map.ycp (added)
+++ trunk/yxmlconv/tests/xml/map.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return $[];
+}
Added: trunk/yxmlconv/tests/xml/map1.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/map1.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/map1.xml (added)
+++ trunk/yxmlconv/tests/xml/map1.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="map1.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><map size="1"><element><key><const type="int" value="1"/></key><value><const type="string" value="one"/></value></element></map></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/map1.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/map1.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/map1.ycp (added)
+++ trunk/yxmlconv/tests/xml/map1.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return $[1:"one"];
+}
Added: trunk/yxmlconv/tests/xml/map2.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/map2.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/map2.xml (added)
+++ trunk/yxmlconv/tests/xml/map2.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="map2.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><map size="2"><element><key><const type="int" value="1"/></key><value><const type="string" value="one"/></value></element><element><key><const type="int" value="2"/></key><value><const type="string" value="two"/></value></element></map></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/map2.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/map2.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/map2.ycp (added)
+++ trunk/yxmlconv/tests/xml/map2.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return $[1:"one", 2:"two"];
+}
Added: trunk/yxmlconv/tests/xml/map3.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/map3.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/map3.xml (added)
+++ trunk/yxmlconv/tests/xml/map3.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="map3.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><map size="3"><element><key><const type="int" value="1"/></key><value><const type="string" value="one"/></value></element><element><key><const type="string" value="three"/></key><value><const type="int" value="3"/></value></element><element><key><const type="symbol" value="zwei"/></key><value><const type="string" value="two"/></value></element></map></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/map3.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/map3.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/map3.ycp (added)
+++ trunk/yxmlconv/tests/xml/map3.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return $[1:"one", `zwei:"two", "three":3];
+}
Added: trunk/yxmlconv/tests/xml/map4.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/map4.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/map4.xml (added)
+++ trunk/yxmlconv/tests/xml/map4.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="map4.ycp"/>
+ <symbol category="variable" type="map" name="cmdline"/>
+ </symbols>
+ <statements>
+ <stmt><textdomain name="en"/></stmt>
+ <stmt><assign name="cmdline"><map size="8"><element><key><const type="string" value="id"/></key><value><const type="string" value="language"/></value></element><element><key><const type="string" value="help"/></key><value><locale domain="en" text="Language configuration"/></value></element><element><key><const type="string" value="guihandler"/></key><value><const type="void"/></value></element><element><key><const type="string" value="initialize"/></key><value><const type="void"/></value></element><element><key><const type="string" value="finish"/></key><value><const type="void"/></value></element><element><key><const type="string" value="actions"/></key><value><map size="3"><element><key><const type="string" value="summary"/></key><value><map size="2"><element><key><const type="string" value="handler"/></key><value><const type="void"/></value></element><element><key><const type="string" value="help"/></key><value><locale domain="en" text="Language configuration summary"/></value></element></map></value></element><element><key><const type="string" value="set"/></key><value><map size="2"><element><key><const type="string" value="handler"/></key><value><const type="void"/></value></element><element><key><const type="string" value="help"/></key><value><locale domain="en" text="Set new values for language"/></value></element></map></value></element><element><key><const type="string" value="list"/></key><value><map size="2"><element><key><const type="string" value="handler"/></key><value><const type="void"/></value></element><element><key><const type="string" value="help"/></key><value><locale domain="en" text="List all available languages."/></value></element></map></value></element></map></value></element><element><key><const type="string" value="options"/></key><value><map size="2"><element><key><const type="string" value="lang"/></key><value><map size="2"><element><key><const type="string" value="help"/></key><value><locale domain="en" text="New language value"/></value></element><element><key><const type="string" value="type"/></key><value><const type="string" value="string"/></value></element></map></value></element><element><key><const type="string" value="languages"/></key><value><map size="2"><element><key><const type="string" value="help"/></key><value><locale domain="en" text="List of secondary languages (separated by commas)"/></value></element><element><key><const type="string" value="type"/></key><value><const type="string" value="string"/></value></element></map></value></element></map></value></element><element><key><const type="string" value="mappings"/></key><value><map size="3"><element><key><const type="string" value="list"/></key><value><list size="0"></list></value></element><element><key><const type="string" value="set"/></key><value><list size="2"><element><const type="string" value="lang"/></element><element><const type="string" value="languages"/></element></list></value></element><element><key><const type="string" value="summary"/></key><value><list size="0"></list></value></element></map></value></element></map></assign></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/map4.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/map4.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/map4.ycp (added)
+++ trunk/yxmlconv/tests/xml/map4.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,48 @@
+{ /* taken from language.ycp */
+
+ textdomain "en";
+
+/* -- the command line description map -------------------------------------- */
+map cmdline = $[
+ "id" : "language",
+ // translators: command line help text for language module
+ "help" : _("Language configuration"),
+ "guihandler" : nil,
+ "initialize" : nil,
+ "finish" : nil,
+ "actions" : $[
+ "summary" :$[
+ "handler" : nil,
+ // command line help text for 'summary' action
+ "help" : _("Language configuration summary"),
+ ],
+ "set" :$[
+ "handler" : nil,
+ // command line help text for 'set' action
+ "help" : _("Set new values for language"),
+ ],
+ "list": $[
+ "handler" : nil,
+ // command line help text for 'list' action
+ "help" : _("List all available languages.")
+ ],
+ ],
+ "options" : $[
+ "lang" : $[
+ // command line help text for 'set lang' option
+ "help" : _("New language value"),
+ "type" : "string"
+ ],
+ "languages" : $[
+ // command line help text for 'set languages' option
+ "help" : _("List of secondary languages (separated by commas)"),
+ "type" : "string"
+ ],
+ ],
+ "mappings" : $[
+ "summary" : [],
+ "set" : [ "lang", "languages" ],
+ "list" : [],
+ ]
+];
+}
Added: trunk/yxmlconv/tests/xml/maplist.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/maplist.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/maplist.xml (added)
+++ trunk/yxmlconv/tests/xml/maplist.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="maplist.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><map size="4"><element><key><const type="int" value="1"/></key><value><list size="1"><element><map size="0"></map></element></list></value></element><element><key><const type="int" value="2"/></key><value><list size="2"><element><const type="symbol" value="two"/></element><element><map size="1"><element><key><const type="int" value="3"/></key><value><const type="string" value="three"/></value></element></map></element></list></value></element><element><key><const type="int" value="3"/></key><value><list size="3"><element><const type="symbol" value="three"/></element><element><map size="1"><element><key><const type="int" value="4"/></key><value><const type="string" value="four"/></value></element></map></element><element><map size="1"><element><key><const type="int" value="5"/></key><value><const type="string" value="fize"/></value></element></map></element></list></value></element><element><key><const type="int" value="4"/></key><value><list size="4"><element><const type="symbol" value="four"/></element><element><map size="1"><element><key><const type="int" value="5"/></key><value><const type="string" value="five"/></value></element></map></element><element><map size="1"><element><key><const type="int" value="6"/></key><value><const type="string" value="six"/></value></element></map></element><element><map size="1"><element><key><const type="int" value="7"/></key><value><const type="string" value="seven"/></value></element></map></element></list></value></element></map></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/maplist.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/maplist.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/maplist.ycp (added)
+++ trunk/yxmlconv/tests/xml/maplist.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return $[ 1:[$[]], 2:[`two, $[3:"three"] ], 3:[`three, $[4:"four"], $[5:"fize"]], 4:[`four, $[5:"five"], $[6:"six"], $[7:"seven"] ] ];
+}
Added: trunk/yxmlconv/tests/xml/mapmap.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/mapmap.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/mapmap.xml (added)
+++ trunk/yxmlconv/tests/xml/mapmap.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="mapmap.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><map size="2"><element><key><const type="int" value="1"/></key><value><map size="1"><element><key><const type="symbol" value="eins"/></key><value><const type="string" value="one"/></value></element></map></value></element><element><key><const type="int" value="2"/></key><value><map size="0"></map></value></element></map></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/mapmap.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/mapmap.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/mapmap.ycp (added)
+++ trunk/yxmlconv/tests/xml/mapmap.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return $[1: $[`eins : "one"] , 2:$[]];
+}
Added: trunk/yxmlconv/tests/xml/path.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/path.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/path.xml (added)
+++ trunk/yxmlconv/tests/xml/path.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="path.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><const type="path" value=".a.path"/></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/path.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/path.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/path.ycp (added)
+++ trunk/yxmlconv/tests/xml/path.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return .a.path;
+}
Added: trunk/yxmlconv/tests/xml/repeat.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/repeat.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/repeat.xml (added)
+++ trunk/yxmlconv/tests/xml/repeat.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="repeat.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><repeat>
+ <do>
+ <block kind="unspec">
+ <statements>
+ <stmt><return><const type="bool" value="false"/></return></stmt>
+ </statements>
+ </block>
+ </do>
+ <until><const type="bool" value="false"/></until>
+</repeat></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/repeat.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/repeat.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/repeat.ycp (added)
+++ trunk/yxmlconv/tests/xml/repeat.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ repeat { return false; } until (false);
+}
Added: trunk/yxmlconv/tests/xml/run
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/run?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/run (added)
+++ trunk/yxmlconv/tests/xml/run Mon Jul 16 12:46:10 2007
@@ -0,0 +1,45 @@
+ycpc -c -x boolean.ycp
+ycpc -c -x builtin_boolean.ycp
+ycpc -c -x builtin_float1.ycp
+ycpc -c -x builtin_float.ycp
+ycpc -c -x builtin_integer.ycp
+ycpc -c -x builtin_string.ycp
+ycpc -c -x float.ycp
+ycpc -c -x if1.ycp
+ycpc -c -x if2.ycp
+ycpc -c -x if.ycp
+ycpc -c -x integer.ycp
+ycpc -c -x list1.ycp
+ycpc -c -x list2.ycp
+ycpc -c -x list3.ycp
+ycpc -c -x list4.ycp
+ycpc -c -x listlist.ycp
+ycpc -c -x listmap.ycp
+ycpc -c -x list.ycp
+ycpc -c -x map1.ycp
+ycpc -c -x map2.ycp
+ycpc -c -x map3.ycp
+ycpc -c -x map4.ycp
+ycpc -c -x maplist.ycp
+ycpc -c -x mapmap.ycp
+ycpc -c -x map.ycp
+ycpc -c -x path.ycp
+ycpc -c -x string.ycp
+ycpc -c -x symbol.ycp
+ycpc -c -x term1.ycp
+ycpc -c -x term.ycp
+ycpc -c -x variable.ycp
+ycpc -c -x void1.ycp
+ycpc -c -x void.ycp
+ycpc -c -x locale.ycp
+ycpc -c -x locale1.ycp
+ycpc -c -x bracket_assign.ycp
+ycpc -c -x compare.ycp
+ycpc -c -x triple.ycp
+ycpc -c -x while.ycp
+ycpc -c -x while1.ycp
+ycpc -c -x yebracket.ycp
+ycpc -c -x repeat.ycp
+ycpc -c -x do.ycp
+
+ycpc -c -x /usr/share/YaST2/clients/language.ycp -o language.xml
Added: trunk/yxmlconv/tests/xml/string.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/string.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/string.xml (added)
+++ trunk/yxmlconv/tests/xml/string.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="string.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><const type="string" value="string"/></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/string.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/string.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/string.ycp (added)
+++ trunk/yxmlconv/tests/xml/string.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return "string";
+}
Added: trunk/yxmlconv/tests/xml/symbol.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/symbol.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/symbol.xml (added)
+++ trunk/yxmlconv/tests/xml/symbol.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="symbol.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><const type="symbol" value="symbol"/></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/symbol.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/symbol.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/symbol.ycp (added)
+++ trunk/yxmlconv/tests/xml/symbol.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return `symbol;
+}
Added: trunk/yxmlconv/tests/xml/term.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/term.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/term.xml (added)
+++ trunk/yxmlconv/tests/xml/term.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="term.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><yeterm name="term" args="0"></yeterm></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/term.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/term.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/term.ycp (added)
+++ trunk/yxmlconv/tests/xml/term.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return `term();
+}
Added: trunk/yxmlconv/tests/xml/term1.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/term1.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/term1.xml (added)
+++ trunk/yxmlconv/tests/xml/term1.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="term1.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><yeterm name="term" args="3"><element><const type="int" value="1"/></element><element><const type="bool" value="false"/></element><element><const type="string" value="true"/></element></yeterm></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/term1.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/term1.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/term1.ycp (added)
+++ trunk/yxmlconv/tests/xml/term1.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return `term(1, false, "true");
+}
Added: trunk/yxmlconv/tests/xml/triple.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/triple.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/triple.xml (added)
+++ trunk/yxmlconv/tests/xml/triple.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="triple.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><yetriple><cond><compare op="=="><lhs><yebinary name="+" type="function"><const type="int" value="1"/><const type="int" value="1"/></yebinary></lhs><rhs><const type="int" value="2"/></rhs></compare></cond><true><const type="bool" value="true"/></true><false><const type="bool" value="false"/></false></yetriple></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/triple.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/triple.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/triple.ycp (added)
+++ trunk/yxmlconv/tests/xml/triple.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return (1+1 == 2) ? true : false;
+}
Added: trunk/yxmlconv/tests/xml/variable.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/variable.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/variable.xml (added)
+++ trunk/yxmlconv/tests/xml/variable.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="variable.ycp"/>
+ <symbol category="variable" type="integer" name="i"/>
+ </symbols>
+ <statements>
+ <stmt><assign name="i"><const type="int" value="1"/></assign></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/variable.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/variable.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/variable.ycp (added)
+++ trunk/yxmlconv/tests/xml/variable.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ integer i = 1;
+}
Added: trunk/yxmlconv/tests/xml/void.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/void.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/void.xml (added)
+++ trunk/yxmlconv/tests/xml/void.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="void.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/void.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/void.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/void.ycp (added)
+++ trunk/yxmlconv/tests/xml/void.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return;
+}
Added: trunk/yxmlconv/tests/xml/void1.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/void1.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/void1.xml (added)
+++ trunk/yxmlconv/tests/xml/void1.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="void1.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><return><const type="void"/></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/void1.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/void1.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/void1.ycp (added)
+++ trunk/yxmlconv/tests/xml/void1.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ return nil;
+}
Added: trunk/yxmlconv/tests/xml/while.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/while.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/while.xml (added)
+++ trunk/yxmlconv/tests/xml/while.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="while.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><while>
+ <cond><const type="bool" value="true"/></cond>
+ <do><return><const type="bool" value="false"/></return> </do>
+</while></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/while.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/while.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/while.ycp (added)
+++ trunk/yxmlconv/tests/xml/while.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,3 @@
+{
+ while (true) return false;
+}
Added: trunk/yxmlconv/tests/xml/while1.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/while1.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/while1.xml (added)
+++ trunk/yxmlconv/tests/xml/while1.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="while1.ycp"/>
+ </symbols>
+ <statements>
+ <stmt><while>
+ <cond><const type="bool" value="true"/></cond>
+ <do><block kind="stmt">
+ <statements>
+ <stmt><return><const type="bool" value="false"/></return></stmt>
+ </statements>
+</block>
+ </do>
+</while></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/while1.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/while1.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/while1.ycp (added)
+++ trunk/yxmlconv/tests/xml/while1.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,5 @@
+{
+ while (true) {
+ return false;
+ }
+}
Added: trunk/yxmlconv/tests/xml/yebracket.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/yebracket.xml?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/yebracket.xml (added)
+++ trunk/yxmlconv/tests/xml/yebracket.xml Mon Jul 16 12:46:10 2007
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ycp version="2.15.8.39280">
+ <block kind="file">
+ <symbols>
+ <symbol global="1" category="filename" type="unspec" name="yebracket.ycp"/>
+ <symbol category="variable" type="map" name="m"/>
+ </symbols>
+ <statements>
+ <stmt><assign name="m"><map size="1"><element><key><const type="int" value="1"/></key><value><const type="int" value="1"/></value></element></map></assign></stmt>
+ <stmt><return><yebracket type="integer"><variable name="m"/><list size="1"><element><const type="int" value="2"/></element></list><const type="int" value="0"/></yebracket></return></stmt>
+ </statements>
+ </block>
+</ycp>
Added: trunk/yxmlconv/tests/xml/yebracket.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/xml/yebracket.ycp?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/xml/yebracket.ycp (added)
+++ trunk/yxmlconv/tests/xml/yebracket.ycp Mon Jul 16 12:46:10 2007
@@ -0,0 +1,4 @@
+{
+ map m = $[1:1];
+ return m[2]:0;
+}
Added: trunk/yxmlconv/tests/yebracket.rb
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yxmlconv/tests/yebracket.rb?rev=39421&view=auto
==============================================================================
--- trunk/yxmlconv/tests/yebracket.rb (added)
+++ trunk/yxmlconv/tests/yebracket.rb Mon Jul 16 12:46:10 2007
@@ -0,0 +1,21 @@
+#
+# yebracket.rb
+#
+
+require 'test/unit'
+require '../src/listener'
+require 'converter_test'
+
+class YeBracketTest < Test::Unit::TestCase
+ def test_converter
+ result = converter_test( "yebracket.xml" )
+ expected = [
+'m = { 1 => 1 }',
+'return m.bracket( [ 2 ], 0 )' ]
+ i = 0
+ result.split("\n").each{ |l|
+ assert l == expected[i]
+ i += 1
+ }
+ end
+end
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org