Index: /ruby/trunk/lib/adl_parser/lib/adl_scanner.rb
===================================================================
--- /ruby/trunk/lib/adl_parser/lib/adl_scanner.rb	(revision 315)
+++ /ruby/trunk/lib/adl_parser/lib/adl_scanner.rb	(revision 316)
@@ -77,8 +77,22 @@
                 @@logger.debug("ADLScanner#scan: COMMENT = #{$&} at #{@filename}:#{@lineno}")
                 ;
-              when /\Adescription/   # description
+              when /\Alanguage/   # language section
+                assert_at(__FILE__,__LINE__){@adl_type.pop == :adl}
+                @adl_type.push(:dadl)
+                yield :SYM_LANGUAGE, :SYM_LANGUAGE
+              when /\Adescription/   # description section
+                assert_at(__FILE__,__LINE__){@adl_type.pop == :dadl}
+                @adl_type.push(:dadl)
                 yield :SYM_DESCRIPTION, :SYM_DESCRIPTION
-              when /\Adefinition/   # definition
+              when /\Adefinition/   # definition section
+                assert_at(__FILE__,__LINE__){@adl_type.pop == :dadl}
+                @adl_type.push(:cadl)
                 yield :SYM_DEFINITION, :SYM_DEFINITION
+              when /\Aontology/   # ontology section
+                assert_at(__FILE__,__LINE__){@adl_type.pop == :cadl}
+                @adl_type.push(:dadl)
+                yield :SYM_ONTOLOGY, :SYM_ONTOLOGY
+              when /\Ainvariatn/   # invariant section
+                raise
               ###----------/* symbols */ ------------------------------------------------- 
               when /\A[A-Z][a-zA-Z0-9_]*/
@@ -316,11 +330,4 @@
                       yield :SYM_END_DBLOCK, :SYM_END_DBLOCK
                     end
-#                     adl_type = @adl_type.pop
-#                     if adl_type == :dadl
-#                       yield :SYM_END_DBLOCK, :SYM_END_DBLOCK
-#                     else
-#                       @in_c_domain_type = false
-#                       yield :END_V_C_DOMAIN_TYPE_BLOCK, :END_V_C_DOMAIN_TYPE_BLOCK
-#                     end
                   else
                     adl_type = @adl_type.pop
Index: /ruby/trunk/lib/adl_parser/test/parser_test.rb
===================================================================
--- /ruby/trunk/lib/adl_parser/test/parser_test.rb	(revision 315)
+++ /ruby/trunk/lib/adl_parser/test/parser_test.rb	(revision 316)
@@ -6,15 +6,15 @@
   end
 
-#   must "assert parser instance" do
-#     assert_instance_of ::OpenEhr::ADL::Parser,@parser
-#   end
-
-#   must "openEHR-EHR-SECTION.summary.v1.adl be properly parsed" do
-#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.summary.v1.adl")
-#     assert_nothing_raised do
-#       ast = @parser.parse(file, 'openEHR-EHR-SECTION.summary.v1')
-#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-#     end
-#   end
+  must "assert parser instance" do
+    assert_instance_of ::OpenEhr::ADL::Parser,@parser
+  end
+
+  must "openEHR-EHR-SECTION.summary.v1.adl be properly parsed" do
+    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.summary.v1.adl")
+    assert_nothing_raised do
+      ast = @parser.parse(file, 'openEHR-EHR-SECTION.summary.v1')
+      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+    end
+  end
 
 #   must "openEHR-EHR-ACTION.imaging.v1.adl be properly parsed" do
@@ -223,11 +223,11 @@
 #   end
 
-  must "openEHR-EHR-OBSERVATION.body_mass_index.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-OBSERVATION.body_mass_index.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'openEHR-EHR-OBSERVATION.body_mass_index.v1')
-      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
-    end
-  end
+#   must "openEHR-EHR-OBSERVATION.body_mass_index.v1.adl be properly parsed" do
+#     file =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-OBSERVATION.body_mass_index.v1.adl")
+#     assert_nothing_raised do
+#       ast = @parser.parse(file, 'openEHR-EHR-OBSERVATION.body_mass_index.v1')
+#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+#     end
+#   end
 
 
