Index: ruby/trunk/adl_parser/lib/scanner.rb
===================================================================
--- ruby/trunk/adl_parser/lib/scanner.rb	(revision 17)
+++ ruby/trunk/adl_parser/lib/scanner.rb	(revision 18)
@@ -10,5 +10,5 @@
       module DADL
         # c.f. http://www.openehr.org/svn/ref_impl_eiffel/TRUNK/components/adl_parser/src/syntax/adl/parser/adl_scanner.l
-        @@dadl_reserved = {
+        RESERVED = {
           'true' => :SYM_TRUE, #[Tt][Rr][Uu][Ee] -- -> SYM_TRUE 
           'false' => :SYM_FALSE, # [Ff][Aa][Ll][Ss][Ee] -- -> SYM_FALSE 
@@ -16,5 +16,5 @@
         }
 
-        LOG = Logger.new('log/scanner.log')
+        LOG = Logger.new('log/scanner.log','daily')
 
         class RootScanner
@@ -22,8 +22,34 @@
           def initialize
             @parser = lambda do |input|
-              Yaparc::Alt.new(
+              Yaparc::Alt.new(Reserved.new,
                               V_QUALIFIED_TERM_CODE_REF.new,
-                              V_LOCAL_TERM_CODE_REF.new
+                              V_LOCAL_TERM_CODE_REF.new,
+                              ERR_V_QUALIFIED_TERM_CODE_REF.new,
+                              V_TYPE_IDENTIFIER.new,
+                              V_GENERIC_TYPE_IDENTIFIER.new,
+                              V_STRING.new,
+                              V_LOCAL_CODE.new,
+                              V_REAL.new
                               )
+            end
+          end
+        end
+
+        class Reserved
+          include Yaparc::Parsable
+          
+          def initialize
+            @parser = lambda do |input|
+              reserved_parsers = OpenEHR::ADL::Scanner::DADL::RESERVED.map do |keyword| 
+                Yaparc::Tokenize.new(Yaparc::Literal.new(keyword))
+              end
+              Yaparc::Alt.new(Yaparc::Apply.new(Yaparc::Alt.new(*reserved_parsers)) do |match|
+                                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|
+                                LOG.info("V_ATTRIBUTE_IDENTIFIER: #{match}")
+                                [:V_ATTRIBUTE_IDENTIFIER, match]
+                              end)
             end
           end
@@ -53,5 +79,80 @@
           end
         end
+
+        class ERR_V_QUALIFIED_TERM_CODE_REF
+          include Yaparc::Parsable
+          def initialize
+            @parser = lambda do |input|
+              Yaparc::Apply.new(Yaparc::Regex.new(/\A\[[a-zA-Z0-9._\- ]+::[a-zA-Z0-9._\- ]+\]/)) do |match|
+                LOG.info("ERR_V_QUALIFIED_TERM_CODE_REF: #{match}")
+                [:ERR_V_QUALIFIED_TERM_CODE_REF, match]
+              end
+            end
+          end
+        end
+
+        class V_TYPE_IDENTIFIER
+          include Yaparc::Parsable
+          def initialize
+            @parser = lambda do |input|
+              Yaparc::Apply.new(Yaparc::Regex.new(/\A[A-Z][a-zA-Z0-9_]*/)) do |match|
+                LOG.info("V_TYPE_IDENTIFIER: #{match}")
+                [:V_TYPE_IDENTIFIER, match]
+              end
+            end
+          end
+        end
+
+        class V_GENERIC_TYPE_IDENTIFIER
+          include Yaparc::Parsable
+          def initialize
+            @parser = lambda do |input|
+              Yaparc::Apply.new(Yaparc::Regex.new(/\A[A-Z][a-zA-Z0-9_]*<[a-zA-Z0-9,_<>]+>/)) do |match|
+                LOG.info("V_GENERIC_TYPE_IDENTIFIER: #{match}")
+                [:V_GENERIC_TYPE_IDENTIFIER, match]
+              end
+            end
+          end
+        end
+
+
+        class V_LOCAL_CODE
+          include Yaparc::Parsable
+          def initialize
+            @parser = lambda do |input|
+              Yaparc::Apply.new(Yaparc::Regex.new(/\Aa[ct][0-9.]+/)) do |match|
+                LOG.info("V_LOCAL_CODE: #{match}")
+                [:V_LOCAL_CODE, match]
+              end
+            end
+          end
+        end
+
+        class V_STRING
+          include Yaparc::Parsable
+          def initialize
+            @parser = lambda do |input|
+              Yaparc::Apply.new(Yaparc::Regex.new(/\A"([^"]*)"/m)) do |match|
+                LOG.info("V_STRING: #{match}")
+                [:V_STRING, match]
+              end
+            end
+          end
+        end
+
+        class V_REAL
+          include Yaparc::Parsable
+          def initialize
+            @parser = lambda do |input|
+              Yaparc::Apply.new(Yaparc::Regex.new(/\A[0-9]+\.[0-9]+|[0-9]+\.[0-9]+[eE][+-]?[0-9]+/)) do |match|
+                LOG.info("V_REAL: #{match}")
+                [:V_REAL, match]
+              end
+            end
+          end
+        end
+
       end # of DADL
+
       module CADL
         # c.f. http://www.openehr.org/svn/ref_impl_eiffel/TRUNK/components/adl_parser/src/syntax/cadl/parser/cadl_scanner.l
