Index: ruby/trunk/lib/adl_parser/test/adl/adl-test-ENTRY.basic_types.v1.adl
===================================================================
--- ruby/trunk/lib/adl_parser/test/adl/adl-test-ENTRY.basic_types.v1.adl	(revision 320)
+++ ruby/trunk/lib/adl_parser/test/adl/adl-test-ENTRY.basic_types.v1.adl	(revision 320)
@@ -0,0 +1,143 @@
+archetype (adl_version=1.4)
+	adl-test-ENTRY.basic_types.v1
+
+concept
+	[at0000]	-- test entry
+language
+	original_language = <[ISO_639-1::en]>
+description
+	original_author = <
+		["name"] = <"Thomas Beale">
+	>
+	details = <
+		["en"] = <
+			language = <[ISO_639-1::en]>
+			purpose = <"test structure">
+			keywords = <"ADL", "test">
+			copyright = <"copyright (c) 2004 The openEHR Foundation">
+		>
+	>
+	lifecycle_state = <"draft">
+
+definition
+	ENTRY[at0000] matches {	-- test entry
+		string_attr1 matches {"something"}
+		string_attr2 matches {/this|that|something else/}
+		string_attr3 matches {/cardio.*/}
+		string_attr4 matches {*}
+		string_attr5 matches {"and", "something", "else"}
+		boolean_attr1 matches {True}
+		boolean_attr2 matches {False}
+		boolean_attr3 matches {True, False}
+		boolean_attr4 matches {*}
+		integer_attr1 matches {|55|}
+		integer_attr2 matches {10, 20, 30}
+		integer_attr3 matches {|0..100|}
+		integer_attr3a matches {|>0..100|}
+		integer_attr3b matches {|0..<100|}
+		integer_attr3c matches {|>0..<100|}
+		integer_attr4 matches {|>10|}
+		integer_attr5 matches {|<10|}
+		integer_attr6 matches {|>=10|}
+		integer_attr7 matches {|<=10|}
+		integer_attr8 matches {|-10..-5|}
+		integer_attr9 matches {|10|}
+		integer_attr10 matches {*}
+		real_attr1 matches {|100.0|}
+		real_attr2 matches {10.0, 20.0, 30.0}
+		real_attr3 matches {|0.0..100.0|}
+		real_attr3a matches {|>0.0..100.0|}
+		real_attr3b matches {|0.0..<100.0|}
+		real_attr3c matches {|>0.0..<100.0|}
+		real_attr4 matches {|>=10.0|}
+		real_attr5 matches {|<=10.0|}
+		real_attr6 matches {|>=10.0|}
+		real_attr7 matches {|<=10.0|}
+		real_attr8 matches {|-10.0..-5.0|}
+		real_attr9 matches {|10.0|}
+		real_attr10 matches {*}
+		date_attr1 matches {yyyy-mm-dd}
+		date_attr2 matches {yyyy-??-??}
+		date_attr3 matches {yyyy-mm-??}
+		date_attr4 matches {yyyy-??-XX}
+		date_attr5 matches {|1983-12-25|}
+		date_attr6 matches {|2000-01-01|}
+		date_attr7 matches {|2000-01-01|}
+		date_attr8 matches {|2000-01-01..2000-02-01|}
+		date_attr8a matches {|>2000-01-01..2000-02-01|}
+		date_attr8b matches {|2000-01-01..<2000-02-01|}
+		date_attr8c matches {|>2000-01-01..<2000-02-01|}
+		time_attr1 matches {hh:mm:ss}
+		time_attr2 matches {hh:mm:??}
+		time_attr3 matches {hh:mm:XX}
+		time_attr4 matches {hh:??:??}
+		time_attr5 matches {hh:??:XX}
+		time_attr6 matches {|22:00:05,0|}
+		time_attr7 matches {|00:00:59,0|}
+		time_attr8 matches {|00:00:59,0|}
+		time_attr9 matches {|01:00:00..02:00:00|}
+		time_attr9a matches {|>01:00:00..02:00:00|}
+		time_attr9b matches {|01:00:00..<02:00:00|}
+		time_attr9c matches {|>01:00:00..<02:00:00|}
+		date_time_attr1 matches {yyyy-mm-ddThh:mm:ss}
+		date_time_attr2 matches {yyyy-mm-ddThh:mm:??}
+		date_time_attr3 matches {yyyy-mm-ddThh:mm:XX}
+		date_time_attr4 matches {yyyy-mm-ddThh:??:??}
+		date_time_attr5 matches {yyyy-mm-ddThh:??:XX}
+		date_time_attr6 matches {yyyy-??-??T??:??:??}
+		date_time_attr7a matches {|1983-12-25T22:00:05,0|}
+		date_time_attr7b matches {|2000-01-01T00:00:59,0|}
+		date_time_attr7c matches {|2000-01-01T00:00:59,0|}
+		date_time_attr9a matches {|2000-01-01T01:00:00..2000-01-01T02:00:00|}
+		date_time_attr9b matches {|>2000-01-01T01:00:00..2000-01-01T02:00:00|}
+		date_time_attr9c matches {|2000-01-01T01:00:00..<2000-01-01T02:00:00|}
+		date_time_attr9d matches {|>2000-01-01T01:00:00..<2000-01-01T02:00:00|}
+		duration_attr1 matches {Pw}
+		duration_attr2 matches {Pmw}
+		duration_attr3 matches {PWD}
+		duration_attr3a matches {PD}
+		duration_attr4 matches {Pym}
+		duration_attr5 matches {PdThms}
+		duration_attr6 matches {PTs}
+		duration_attr7 matches {PThm}
+		duration_attr8 matches {|PT0S|}
+		duration_attr8a matches {|PT0.004S|}
+		duration_attr9 matches {|P1D|}
+		duration_attr10 matches {|P38W..P39W4D|}
+		duration_attr10a matches {|>P38W..P39W4D|}
+		duration_attr10b matches {|P38W..<P39W4D|}
+		duration_attr10c matches {|>P38W..<P39W4D|}
+		duration_attr11 matches {|PT2H5M|}
+		duration_attr12 matches {|PT1H55M|}
+		duration_attr13 matches {|<=PT1H|}
+		duration_attr14 matches {|PT1H30M|}
+		duration_attr101 matches {Pw/|PT0S|}
+		duration_attr102 matches {Pmw/|PT0S|}
+		duration_attr103 matches {PWD/|PT0S|}
+		duration_attr103a matches {PD/|PT0S|}
+		duration_attr104 matches {Pym/|PT0S|}
+		duration_attr105 matches {PdThms/|PT0S|}
+		duration_attr106 matches {PTs/|PT0S|}
+		duration_attr107 matches {PThm/|PT0S|}
+		duration_attr201 matches {Pw/|P38W..P39W4D|}
+		duration_attr202 matches {Pmw/|P38W..P39W4D|}
+		duration_attr203 matches {PWD/|P38W..P39W4D|}
+		duration_attr203a matches {PD/|P38W..P39W4D|}
+		duration_attr204 matches {Pym/|P38W..P39W4D|}
+		duration_attr205 matches {PdThms/|P38W..P39W4D|}
+		duration_attr206 matches {PTs/|P38W..P39W4D|}
+		duration_attr207 matches {PThm/|P38W..P39W4D|}
+	}
+
+ontology
+	terminologies_available = <"adl_test", ...>
+	term_definitions = <
+		["en"] = <
+			items = <
+				["at0000"] = <
+					description = <"test entry">
+					text = <"test entry">
+				>
+			>
+		>
+	>
Index: ruby/trunk/lib/adl_parser/test/parser_test.rb
===================================================================
--- ruby/trunk/lib/adl_parser/test/parser_test.rb	(revision 319)
+++ ruby/trunk/lib/adl_parser/test/parser_test.rb	(revision 320)
@@ -6,7 +6,7 @@
   end
 
-  must "assert parser instance" do
-    assert_instance_of ::OpenEhr::ADL::Parser,@parser
-  end
+#   must "assert parser instance" do
+#     assert_instance_of ::OpenEhr::ADL::Parser,@parser
+#   end
 
 #   must "openEHR-EHR-CLUSTER.exam-uterus.v1.adl be properly parsed" do
@@ -265,3 +265,11 @@
   end
 
+#   must "adl-test-ENTRY.basic_types.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/adl-test-ENTRY.basic_types.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'adl-test-ENTRY.basic_types.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
+
 end
Index: ruby/trunk/lib/adl_parser/test/scanner_test.rb
===================================================================
--- ruby/trunk/lib/adl_parser/test/scanner_test.rb	(revision 319)
+++ ruby/trunk/lib/adl_parser/test/scanner_test.rb	(revision 320)
@@ -74,8 +74,31 @@
   end
 
+  must "assert CADLScanner scanner scan V_STRING" do
+    @scanner.scan("\"string\"") do |sym, val|
+      assert_equal :V_STRING,sym
+      assert_equal "string",val
+    end
+    @scanner.scan("\"1605E211E9BFB4093A72CCE7A9792FF9\"") do |sym, val|
+      assert_equal :V_STRING,sym
+      assert_equal "1605E211E9BFB4093A72CCE7A9792FF9",val
+    end
+  end
+
   must "assert CADLScanner scanner scan V_QUALIFIED_TERM_CODE_REF" do
     @scanner.scan("[ICD10AM(1998)::F23]") do |sym, val|
       assert_equal :V_QUALIFIED_TERM_CODE_REF,sym
       assert_equal "ICD10AM(1998)::F23",val
+    end
+  end
+
+
+  must "assert CADLScanner scanner scan V_ISO8601_DURATION_CONSTRAINT_PATTERN" do
+    @scanner.scan("PW") do |sym, val|
+      assert_equal :V_ISO8601_DURATION_CONSTRAINT_PATTERN,sym
+      assert_equal "PW",val
+    end
+    @scanner.scan("PTs") do |sym, val|
+      assert_equal :V_ISO8601_DURATION_CONSTRAINT_PATTERN,sym
+      assert_equal "PTs",val
     end
   end
@@ -89,25 +112,20 @@
     @scanner.scan("P1D") do |sym, val|
       assert_equal :V_ISO8601_DURATION,sym
-      assert_equal "PT1M",val
+      assert_equal "P1D",val
+    end
+
+    @scanner.scan("PT1H30M") do |sym, val|
+      assert_equal :V_ISO8601_DURATION,sym
+      assert_equal "PT1H30M",val
     end
   end
 
-  must "assert CADLScanner scanner scan V_STRING" do
-    @scanner.scan("\"string\"") do |sym, val|
-      assert_equal :V_STRING,sym
-      assert_equal "string",val
-    end
-    @scanner.scan("\"1605E211E9BFB4093A72CCE7A9792FF9\"") do |sym, val|
-      assert_equal :V_STRING,sym
-      assert_equal "1605E211E9BFB4093A72CCE7A9792FF9",val
+  must "assert CADLScanner scanner scan V_ISO8601_EXTENDED_DATE_TIME" do
+    @scanner.scan("2000-01-01T01:00:00") do |sym, val|
+      assert_equal :V_ISO8601_EXTENDED_DATE_TIME,sym
+      assert_equal "2000-01-01T01:00:00",val
     end
   end
 
-  must "assert CADLScanner scanner scan V_ISO8601_DURATION_CONSTRAINT_PATTERN" do
-    @scanner.scan("PW") do |sym, val|
-      assert_equal :V_ISO8601_DURATION_CONSTRAINT_PATTERN,sym
-      assert_equal "PW",val
-    end
-  end
 end
 
@@ -155,2 +173,15 @@
   end
 end
+
+class RegexScannerTest < Test::Unit::TestCase
+  def setup
+    @scanner = OpenEhr::ADL::Scanner::RegexScanner.new([:regexp], "filename")
+  end
+
+  must "assert RegexScanner scanner scan " do
+    @scanner.scan("this|that|something else") do |sym, val|
+      assert_equal :REGEXP_BODY,sym
+      assert_equal "this|that|something else",val
+    end
+  end
+end
