Index: ruby/trunk/lib/adl_parser/lib/adl_scanner.rb
===================================================================
--- ruby/trunk/lib/adl_parser/lib/scanner.rb	(revision 49)
+++ ruby/trunk/lib/adl_parser/lib/adl_scanner.rb	(revision 261)
@@ -8,4 +8,17 @@
     module Scanner
       module Common
+        class START_TERM_CODE_CONSTRAINT
+          include Yaparc::Parsable
+          def initialize
+            @parser = lambda do |input|
+              Yaparc::Apply.new(Yaparc::Regex.new(/[ \t\n]*\[([a-zA-Z0-9\(\)\._\-]+)::[ \t\n]*/)) do |match|
+                OpenEHR::LOG.info("START_TERM_CODE_CONSTRAINT: #{match}")
+                [:START_TERM_CODE_CONSTRAINT, match]
+              end
+            end
+          end
+        end
+
+        # /\A\[[a-zA-Z0-9()\._-]+::[a-zA-Z0-9\._-]+\]/  #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]
         class V_QUALIFIED_TERM_CODE_REF
           include Yaparc::Parsable
@@ -13,5 +26,5 @@
             @parser = lambda do |input|
               Yaparc::Apply.new(Yaparc::Regex.new(/\A\[[a-zA-Z0-9()\._-]+::[a-zA-Z0-9\._-]+\]/)) do |match|
-                OpenEHR::LOG.debug("V_QUALIFIED_TERM_CODE_REF: #{match}")
+                OpenEHR::LOG.info("V_QUALIFIED_TERM_CODE_REF: #{match}")
                 [:V_QUALIFIED_TERM_CODE_REF, match]
               end
@@ -25,5 +38,5 @@
             @parser = lambda do |input|
               Yaparc::Apply.new(Yaparc::Regex.new(/\A\[[a-zA-Z0-9][a-zA-Z0-9._\-]*\]/)) do |match|
-                OpenEHR::LOG.debug("V_TERM_CODE_REF: #{match}")
+                OpenEHR::LOG.info("V_TERM_CODE_REF: #{match}")
                 [:V_LOCAL_TERM_CODE_REF, match]
               end
@@ -37,5 +50,5 @@
             @parser = lambda do |input|
               Yaparc::Apply.new(Yaparc::Regex.new(/\A\[[a-zA-Z0-9._\- ]+::[a-zA-Z0-9._\- ]+\]/)) do |match|
-                OpenEHR::LOG.debug("ERR_V_QUALIFIED_TERM_CODE_REF: #{match}")
+                OpenEHR::LOG.info("ERR_V_QUALIFIED_TERM_CODE_REF: #{match}")
                 [:ERR_V_QUALIFIED_TERM_CODE_REF, match]
               end
@@ -49,5 +62,5 @@
             @parser = lambda do |input|
               Yaparc::Apply.new(Yaparc::Regex.new(/\A[A-Z][a-zA-Z0-9_]*/)) do |match|
-                OpenEHR::LOG.debug("V_TYPE_IDENTIFIER: #{match}")
+                OpenEHR::LOG.info("V_TYPE_IDENTIFIER: #{match}")
                 [:V_TYPE_IDENTIFIER, match]
               end
@@ -61,5 +74,5 @@
             @parser = lambda do |input|
               Yaparc::Apply.new(Yaparc::Regex.new(/\A[A-Z][a-zA-Z0-9_]*<[a-zA-Z0-9,_<>]+>/)) do |match|
-                OpenEHR::LOG.debug("V_GENERIC_TYPE_IDENTIFIER: #{match}")
+                OpenEHR::LOG.info("V_GENERIC_TYPE_IDENTIFIER: #{match}")
                 [:V_GENERIC_TYPE_IDENTIFIER, match]
               end
@@ -74,5 +87,5 @@
             @parser = lambda do |input|
               Yaparc::Apply.new(Yaparc::Regex.new(/\Aa[ct][0-9.]+/)) do |match|
-                OpenEHR::LOG.debug("V_LOCAL_CODE: #{match}")
+                OpenEHR::LOG.info("V_LOCAL_CODE: #{match}")
                 [:V_LOCAL_CODE, match]
               end
@@ -86,5 +99,5 @@
             @parser = lambda do |input|
               Yaparc::Apply.new(Yaparc::Regex.new(/\A"([^"]*)"/m)) do |match|
-                OpenEHR::LOG.debug("V_STRING: #{match}")
+                OpenEHR::LOG.info("V_STRING: #{match}")
                 [:V_STRING, match]
               end
@@ -98,5 +111,5 @@
             @parser = lambda do |input|
               Yaparc::Apply.new(Yaparc::Regex.new(/\A[0-9]+\.[0-9]+|[0-9]+\.[0-9]+[eE][+-]?[0-9]+/)) do |match|
-                OpenEHR::LOG.debug("V_REAL: #{match}")
+                OpenEHR::LOG.info("V_REAL: #{match}")
                 [:V_REAL, match]
               end
@@ -113,5 +126,5 @@
                                 Yaparc::Alt.new(Yaparc::Regex.new(/\AP([0-9]+|[yY])?([0-9]+|[mM])?([0-9]+|[wW])?([0-9]+|[dD])?T([0-9]+|[hH])?([0-9]+|[mM])?([0-9]+|[sS])?/),
                                                 Yaparc::Regex.new(/\AP([0-9]+|[yY])?([0-9]+|[mM])?([0-9]+|[wW])?([0-9]+|[dD])?/))) do |match|
-                OpenEHR::LOG.debug("V_ISO8601_DURATION: #{match}")
+                OpenEHR::LOG.info("V_ISO8601_DURATION: #{match}")
                 [:V_ISO8601_DURATION, match]
               end
@@ -129,5 +142,7 @@
           'infinity' => :SYM_INFINITY # [Ii][Nn][Ff][Ii][Nn][Ii][Tt][Yy] -- -> SYM_INFINITY 
         }
-
+        #
+        # DADL::RootScanner
+        #
         class RootScanner
           include Yaparc::Parsable
@@ -143,11 +158,12 @@
                               OpenEHR::ADL::Scanner::Common::V_LOCAL_CODE.new,
                               OpenEHR::ADL::Scanner::Common::V_REAL.new,
-                              OpenEHR::ADL::Scanner::Common::V_ISO8601_DURATION.new
+                              OpenEHR::ADL::Scanner::Common::V_ISO8601_DURATION.new#,
+                              #OpenEHR::ADL::Scanner::Common::START_TERM_CODE_CONSTRAINT.new
                               )
             end
           end
         end
-=begin <DADL::Reserved class>
-=end
+
+        #  <DADL::Reserved class>
         class Reserved
           include Yaparc::Parsable
@@ -161,9 +177,9 @@
               end
               Yaparc::Alt.new(Yaparc::Apply.new(Yaparc::Alt.new(*reserved_parsers)) do |match|
-                                OpenEHR::LOG.debug("Reserved: #{match}")
+                                OpenEHR::LOG.info("Reserved: #{match}")
                                 [OpenEHR::ADL::Scanner::DADL::RESERVED[match], OpenEHR::ADL::Scanner::DADL::RESERVED[match]]
                               end,
                               Yaparc::Apply.new(Yaparc::Regex.new(/\A[a-z][a-zA-Z0-9_]*/)) do |match|
-                                OpenEHR::LOG.debug("V_ATTRIBUTE_IDENTIFIER: #{match}")
+                                OpenEHR::LOG.info("V_ATTRIBUTE_IDENTIFIER: #{match}")
                                 [:V_ATTRIBUTE_IDENTIFIER, match]
                               end)
@@ -171,7 +187,4 @@
           end
         end
-
-
-
       end # of DADL
 
@@ -213,5 +226,5 @@
             @parser = lambda do |input|
               Yaparc::Apply.new(Yaparc::Regex.new(/\A[yY][yY][yY][yY]-[mM?X][mM?X]-[dD?X][dD?X][T\t][hH?X][hH?X]:[mM?X][mM?X]:[sS?X][sS?X]/)) do |match|
-                OpenEHR::LOG.debug("V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN: #{match}")
+                OpenEHR::LOG.info("V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN: #{match}")
                 [:V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN, match]
               end
@@ -226,5 +239,5 @@
             @parser = lambda do |input|
               Yaparc::Apply.new(Yaparc::Regex.new(/\A[yY][yY][yY][yY]-[mM?X][mM?X]-[dD?X][dD?X]/)) do |match|
-                OpenEHR::LOG.debug("V_ISO8601_DATE_CONSTRAINT_PATTERN: #{match}")
+                OpenEHR::LOG.info("V_ISO8601_DATE_CONSTRAINT_PATTERN: #{match}")
                 [:V_ISO8601_DATE_CONSTRAINT_PATTERN, match]
               end
@@ -239,5 +252,5 @@
             @parser = lambda do |input|
               Yaparc::Apply.new(Yaparc::Regex.new(/\A[hH][hH]:[mM?X][mM?X]:[sS?X][sS?X]/)) do |match|
-                OpenEHR::LOG.debug("V_ISO8601_TIME_CONSTRAINT_PATTERN: #{match}")
+                OpenEHR::LOG.info("V_ISO8601_TIME_CONSTRAINT_PATTERN: #{match}")
                 [:V_ISO8601_TIME_CONSTRAINT_PATTERN, match]
               end
@@ -253,5 +266,5 @@
               Yaparc::Apply.new(Yaparc::Alt.new(Yaparc::Regex.new(/\AP[yY]?[mM]?[wW]?[dD]?T[hH]?[mM]?[sS]?/),
                                                 Yaparc::Regex.new(/\AP[yY]?[mM]?[wW]?[dD]?/))) do |match|
-                OpenEHR::LOG.debug("V_ISO8601_DURATION_CONSTRAINT_PATTERN: #{match}")
+                OpenEHR::LOG.info("V_ISO8601_DURATION_CONSTRAINT_PATTERN: #{match}")
                 [:V_ISO8601_DURATION_CONSTRAINT_PATTERN, match]
               end
@@ -266,5 +279,5 @@
             @parser = lambda do |input|
               Yaparc::Apply.new(Yaparc::Regex.new(/\A[A-Z][a-zA-Z0-9_]*[ \n]*\</)) do |match|
-                OpenEHR::LOG.debug("V_C_DOMAIN_TYPE: #{match}")
+                OpenEHR::LOG.info("V_C_DOMAIN_TYPE: #{match}")
                 [:START_V_C_DOMAIN_TYPE_BLOCK, match]
               end
@@ -273,4 +286,7 @@
         end
 
+        #
+        # CADL::RootScanner
+        #
         class RootScanner
           include Yaparc::Parsable
@@ -292,5 +308,6 @@
                               OpenEHR::ADL::Scanner::Common::V_LOCAL_CODE.new,
                               OpenEHR::ADL::Scanner::Common::V_REAL.new,
-                              OpenEHR::ADL::Scanner::Common::V_ISO8601_DURATION.new
+                              OpenEHR::ADL::Scanner::Common::V_ISO8601_DURATION.new#,
+                              #OpenEHR::ADL::Scanner::Common::START_TERM_CODE_CONSTRAINT.new
                               )
             end
@@ -310,9 +327,9 @@
               end
               Yaparc::Alt.new(Yaparc::Apply.new(Yaparc::Alt.new(*reserved_parsers)) do |match|
-                                OpenEHR::LOG.debug("Reserved: #{match}")
+                                OpenEHR::LOG.info("Reserved: #{match}")
                                 [OpenEHR::ADL::Scanner::CADL::RESERVED[match], OpenEHR::ADL::Scanner::CADL::RESERVED[match]]
                               end,
                               Yaparc::Apply.new(Yaparc::Regex.new(/\A[a-z][a-zA-Z0-9_]*/)) do |match|
-                                OpenEHR::LOG.debug("V_ATTRIBUTE_IDENTIFIER: #{match}")
+                                OpenEHR::LOG.info("V_ATTRIBUTE_IDENTIFIER: #{match}")
                                 [:V_ATTRIBUTE_IDENTIFIER, match]
                               end)
