Index: ruby/branches/TRY-open_ehr_gem/lib/open_ehr.rb
===================================================================
--- ruby/branches/TRY-open_ehr_gem/lib/open_ehr.rb	(revision 322)
+++ ruby/branches/TRY-open_ehr_gem/lib/open_ehr.rb	(revision 323)
@@ -47,4 +47,5 @@
         autoload :CARDINALITY, "am/archetype/constraint_model/archetype_constraint.rb"
         autoload :C_SINGLE_ATTRIBUTE, "am/archetype/constraint_model/archetype_constraint.rb"
+        autoload :C_COMPLEX_OBJECT, "am/archetype/constraint_model/archetype_constraint.rb"
         autoload :ARCHETYPE_SLOT, "am/archetype/constraint_model/archetype_constraint.rb"
         autoload :Primitive, "am/archetype/constraint_model/primitive.rb"
Index: ruby/trunk/lib/adl_parser/lib/adl_exception.rb
===================================================================
--- ruby/trunk/lib/adl_parser/lib/adl_exception.rb	(revision 322)
+++ ruby/trunk/lib/adl_parser/lib/adl_exception.rb	(revision 323)
@@ -5,8 +5,59 @@
       end
 
-      module CADLScanner
+      module Scanner
         class Base < RuntimeError
         end
       end
+
+      module Parser
+        class Base < RuntimeError
+        end
+      end
+
+
+      #
+      #
+      # c.f. beale07:_archet_defin_languag,p.100
+      module Validation
+        class Base < RuntimeError
+        end
+
+        class VARID < Base
+          MESSAGE = "The archetype must have an identifier value for the archetype_id section. The identifier must conform to the published openEHR specification for archetype identifiers."
+        end
+
+        class VARCN < Base
+          MESSAGE = "The archetype must have an archetype term value in concept section. The term must exist in the archetype ontology."
+        end
+
+        class VARDF < Base
+          MESSAGE = "The archetype must have a definition section, expressed as a cADL syntax."
+        end
+
+        class VARON < Base
+          MESSAGE = "The archetype must have a ontology section, expressed as a dADL syntax."
+        end
+
+        class VARDT < Base
+          MESSAGE = "The topmost typename mentioned in the archetype definition section must match the type mentioned in the type-name slot of the first segment of the archetype id."
+        end
+
+        class VATDF < Base
+          MESSAGE = "Each archetype term used as a node identifier the archetype definition must be defined in the term_definitions part of the ontology."
+        end
+
+        class VACDF < Base
+          MESSAGE = "Each constraint code used in the archetype definition must be defined in the constraint_definition part of the ontology."
+        end
+
+        class VDFAI < Base
+          MESSAGE = "Any archetype identifier mentioned in an archetype slot in the definition section must conform to the published openEHR specification for archetype identifiers."
+        end
+
+        class VDFPT < Base
+          MESSAGE = "Any path mentioned in the definition section must be valid syntactically, and a valid path with respect to the hierarchical structure of the definition section."
+        end
+      end
+
     end
   end
Index: ruby/trunk/lib/adl_parser/lib/adl_scanner.rb
===================================================================
--- ruby/trunk/lib/adl_parser/lib/adl_scanner.rb	(revision 322)
+++ ruby/trunk/lib/adl_parser/lib/adl_scanner.rb	(revision 323)
@@ -89,6 +89,5 @@
               when /\A(\w+)-(\w+)-(\w+)\.(\w+)((?:-\w+)*)\.(v\w+)/   #V_ARCHETYPE_ID
                 object_id, rm_originator, rm_name, rm_entity, concept_name, specialisation, version_id = $&, $1, $2, $3, $4, $5, $6
-                #archetype_id = OpenEhr::RM::Support::Identification::ArchetypeID.new(object_id, concept_name, rm_name, rm_entity, rm_originator, specialisation, version_id)
-                archetype_id = OpenEhr::RM::Support::Identification::ArchetypeID.new(:concept_name => concept_name, :rm_name => rm_name, :rm_entity => rm_entity, :rm_originator => :rm_originator, :specialisation => specialisation, :version_id => version_id)
+                archetype_id = OpenEhr::RM::Support::Identification::ArchetypeID.new(:concept_name => concept_name, :rm_name => rm_name, :rm_entity => rm_entity, :rm_originator => rm_originator, :specialisation => specialisation, :version_id => version_id)
                 yield :V_ARCHETYPE_ID, archetype_id
               when /\A[a-z][a-zA-Z0-9_]*/
@@ -848,335 +847,2 @@
 
 
-#       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
-#           def initialize
-#             @parser = lambda do |input|
-#               Yaparc::Apply.new(Yaparc::Regex.new(/\A\[[a-zA-Z0-9()\._-]+::[a-zA-Z0-9\._-]+\]/)) do |match|
-#                 OpenEhr::LOG.info("V_QUALIFIED_TERM_CODE_REF: #{match}")
-#                 [:V_QUALIFIED_TERM_CODE_REF, match]
-#               end
-#             end
-#           end
-#         end
-        
-#         class V_LOCAL_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|
-#                 OpenEhr::LOG.info("V_TERM_CODE_REF: #{match}")
-#                 [:V_LOCAL_TERM_CODE_REF, match]
-#               end
-#             end
-#           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|
-#                 OpenEhr::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|
-#                 OpenEhr::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|
-#                 OpenEhr::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|
-#                 OpenEhr::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|
-#                 OpenEhr::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|
-#                 OpenEhr::LOG.info("V_REAL: #{match}")
-#                 [:V_REAL, match]
-#               end
-#             end
-#           end
-#         end
-
-#         #V_ISO8601_DURATION PnYnMnWnDTnnHnnMnnS
-#         class V_ISO8601_DURATION
-#           include Yaparc::Parsable
-#           def initialize
-#             @parser = lambda do |input|
-#               Yaparc::Apply.new(
-#                                 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.info("V_ISO8601_DURATION: #{match}")
-#                 [:V_ISO8601_DURATION, match]
-#               end
-#             end
-#           end
-#         end
-
-#       end # of Common
-
-#       module DADL
-#         # c.f. http://www.openehr.org/svn/ref_impl_eiffel/TRUNK/components/adl_parser/src/syntax/adl/parser/adl_scanner.l
-#         RESERVED = {
-#           'true' => :SYM_TRUE, #[Tt][Rr][Uu][Ee] -- -> SYM_TRUE 
-#           'false' => :SYM_FALSE, # [Ff][Aa][Ll][Ss][Ee] -- -> SYM_FALSE 
-#           'infinity' => :SYM_INFINITY # [Ii][Nn][Ff][Ii][Nn][Ii][Tt][Yy] -- -> SYM_INFINITY 
-#         }
-#         #
-#         # DADL::RootScanner
-#         #
-#         class RootScanner
-#           include Yaparc::Parsable
-#           def initialize
-#             @parser = lambda do |input|
-#               Yaparc::Alt.new(Reserved.new,
-#                               OpenEhr::ADL::Scanner::Common::V_QUALIFIED_TERM_CODE_REF.new,
-#                               OpenEhr::ADL::Scanner::Common::V_LOCAL_TERM_CODE_REF.new,
-#                               OpenEhr::ADL::Scanner::Common::ERR_V_QUALIFIED_TERM_CODE_REF.new,
-#                               OpenEhr::ADL::Scanner::Common::V_TYPE_IDENTIFIER.new,
-#                               OpenEhr::ADL::Scanner::Common::V_GENERIC_TYPE_IDENTIFIER.new,
-#                               OpenEhr::ADL::Scanner::Common::V_STRING.new,
-#                               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::START_TERM_CODE_CONSTRAINT.new
-#                               )
-#             end
-#           end
-#         end
-
-#         #  <DADL::Reserved class>
-#         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[0],false)
-#                                      )
-#               end
-#               Yaparc::Alt.new(Yaparc::Apply.new(Yaparc::Alt.new(*reserved_parsers)) do |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.info("V_ATTRIBUTE_IDENTIFIER: #{match}")
-#                                 [:V_ATTRIBUTE_IDENTIFIER, 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
-#         RESERVED = {
-#           'ordered' => :SYM_ORDERED, # [Oo][Rr][Dd][Ee][Rr][Ee][Dd]
-#           'unordered' => :SYM_UNORDERED, # [Uu][Nn][Oo][Rr][Dd][Ee][Rr][Ee][Dd]
-#           'then' => :SYM_THEN, # [Tt][Hh][Ee][Nn]
-#           'else' => :SYM_ELSE, # [Ee][Ll][Ss][Ee]
-#           'and' => :SYM_AND, # [Aa][Nn][Dd]
-#           'or' => :SYM_OR, # [Oo][Rr]
-#           'xor' => :SYM_XOR, # [Xx][Oo][Rr]
-#           'not' => :SYM_NOT, # [Nn][Oo][Tt]
-#           'implies' => :SYM_IMPLIES, # [Ii][Mm][Pp][Ll][Ii][Ee][Ss]
-#           'true' => :SYM_TRUE, #[Tt][Rr][Uu][Ee] -- -> SYM_TRUE 
-#           'false' => :SYM_FALSE, # [Ff][Aa][Ll][Ss][Ee] -- -> SYM_FALSE 
-#           'forall' => :SYM_FORALL, # [Ff][Oo][Rr][_][Aa][Ll][Ll]
-#           'exists' => :SYM_EXISTS, # [Ee][Xx][Ii][Ss][Tt][Ss]
-#           'existence' => :SYM_EXISTENCE, # [Ee][Xx][Iu][Ss][Tt][Ee][Nn][Cc][Ee]
-#           'occurrences' => :SYM_OCCURRENCES, # [Oo][Cc][Cc][Uu][Rr][Rr][Ee][Nn][Cc][Ee][Ss]
-#           'cardinality' => :SYM_CARDINALITY, # [Cc][Aa][Rr][Dd][Ii][Nn][Aa][Ll][Ii][Tt][Yy]
-#           'unique' => :SYM_UNIQUE, # [Uu][Nn][Ii][Qq][Uu][Ee]
-#           'matches' => :SYM_MATCHES, # [Mm][Aa][Tt][Cc][Hh][Ee][Ss]
-#           'is_in' => :SYM_MATCHES, # [Ii][Ss][_][Ii][Nn]
-#           'invariant' => :SYM_INVARIANT, # [Ii][Nn][Vv][Aa][Rr][Ii][Aa][Nn][Tt]
-#           'infinity' => :SYM_INFINITY, # [Ii][Nn][Ff][Ii][Nn][Ii][Tt][Yy] -- -> SYM_INFINITY 
-#           'use_node' => :SYM_USE_NODE, # [Uu][Ss][Ee][_][Nn][Oo][Dd][Ee]
-#           'use_archetype' => :SYM_ALLOW_ARCHETYPE, # [Uu][Ss][Ee][_][Aa][Rr][Cc][Hh][Ee][Tt][Yy][Pp][Ee]
-#           'allow_archetype' => :SYM_ALLOW_ARCHETYPE, # [Aa][Ll][Ll][Oo][Ww][_][Aa][Rr][Cc][Hh][Ee][Tt][Yy][Pp][Ee]
-#           'include' => :SYM_INCLUDE, # [Ii][Nn][Cc][Ll][Uu][Dd][Ee]
-#           'exclude' => :SYM_EXCLUDE # [Ee][Xx][Cc][Ll][Uu][Dd][Ee]
-#         }
-
-#         #V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN, /\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]/
-#         class V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN
-#           include Yaparc::Parsable
-#           def initialize
-#             @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.info("V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN: #{match}")
-#                 [:V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN, match]
-#               end
-#             end
-#           end
-#         end
-
-#         #V_ISO8601_DATE_CONSTRAINT_PATTERN  /\A[yY][yY][yY][yY]-[mM?X][mM?X]-[dD?X][dD?X]/
-#         class V_ISO8601_DATE_CONSTRAINT_PATTERN
-#           include Yaparc::Parsable
-#           def initialize
-#             @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.info("V_ISO8601_DATE_CONSTRAINT_PATTERN: #{match}")
-#                 [:V_ISO8601_DATE_CONSTRAINT_PATTERN, match]
-#               end
-#             end
-#           end
-#         end
-
-#         #V_ISO8601_TIME_CONSTRAINT_PATTERN /\A[hH][hH]:[mM?X][mM?X]:[sS?X][sS?X]/
-#         class V_ISO8601_TIME_CONSTRAINT_PATTERN
-#           include Yaparc::Parsable
-#           def initialize
-#             @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.info("V_ISO8601_TIME_CONSTRAINT_PATTERN: #{match}")
-#                 [:V_ISO8601_TIME_CONSTRAINT_PATTERN, match]
-#               end
-#             end
-#           end
-#         end
-
-#         #V_ISO8601_DURATION_CONSTRAINT_PATTERN 
-#         class V_ISO8601_DURATION_CONSTRAINT_PATTERN
-#           include Yaparc::Parsable
-#           def initialize
-#             @parser = lambda do |input|
-#               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.info("V_ISO8601_DURATION_CONSTRAINT_PATTERN: #{match}")
-#                 [:V_ISO8601_DURATION_CONSTRAINT_PATTERN, match]
-#               end
-#             end
-#           end
-#         end
-
-#         #V_C_DOMAIN_TYPE /\A[A-Z][a-zA-Z0-9_]*[ \n]*\</
-#         class V_C_DOMAIN_TYPE
-#           include Yaparc::Parsable
-#           def initialize
-#             @parser = lambda do |input|
-#               Yaparc::Apply.new(Yaparc::Regex.new(/\A[A-Z][a-zA-Z0-9_]*[ \n]*\</)) do |match|
-#                 OpenEhr::LOG.info("V_C_DOMAIN_TYPE: #{match}")
-#                 [:START_V_C_DOMAIN_TYPE_BLOCK, match]
-#               end
-#             end
-#           end
-#         end
-
-#         #
-#         # CADL::RootScanner
-#         #
-#         class RootScanner
-#           include Yaparc::Parsable
-#           def initialize
-#             @parser = lambda do |input|
-#               Yaparc::Alt.new(V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN.new,
-#                               V_ISO8601_DATE_CONSTRAINT_PATTERN.new,
-#                               V_ISO8601_TIME_CONSTRAINT_PATTERN.new,
-#                               OpenEhr::ADL::Scanner::Common::V_ISO8601_DURATION.new,
-#                               V_C_DOMAIN_TYPE.new,
-#                               V_ISO8601_DURATION_CONSTRAINT_PATTERN.new,
-#                               Reserved.new,
-#                               OpenEhr::ADL::Scanner::Common::V_QUALIFIED_TERM_CODE_REF.new,
-#                               OpenEhr::ADL::Scanner::Common::V_LOCAL_TERM_CODE_REF.new,
-#                               OpenEhr::ADL::Scanner::Common::ERR_V_QUALIFIED_TERM_CODE_REF.new,
-#                               OpenEhr::ADL::Scanner::Common::V_TYPE_IDENTIFIER.new,
-#                               OpenEhr::ADL::Scanner::Common::V_GENERIC_TYPE_IDENTIFIER.new,
-#                               OpenEhr::ADL::Scanner::Common::V_STRING.new,
-#                               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::START_TERM_CODE_CONSTRAINT.new
-#                               )
-#             end
-#           end
-#         end
-
-#         # <CADL::Reserved class>
-#         class Reserved
-#           include Yaparc::Parsable
-          
-#           def initialize
-#             @parser = lambda do |input|
-#               orderd_reserved = RESERVED.keys.sort{|x,y| y.length <=> x.length  }
-#               reserved_parsers = orderd_reserved.map do |keyword| 
-#                 Yaparc::Literal.new(keyword,false)
-#               end
-#               Yaparc::Alt.new(Yaparc::Apply.new(Yaparc::Alt.new(*reserved_parsers)) do |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.info("V_ATTRIBUTE_IDENTIFIER: #{match}")
-#                                 [:V_ATTRIBUTE_IDENTIFIER, match]
-#                               end)
-#             end
-#           end
-#         end
-
-#       end
-
-
Index: ruby/trunk/lib/adl_parser/lib/parser.rb
===================================================================
--- ruby/trunk/lib/adl_parser/lib/parser.rb	(revision 322)
+++ ruby/trunk/lib/adl_parser/lib/parser.rb	(revision 323)
@@ -27,5 +27,5 @@
     class Parser < Racc::Parser
 
-module_eval(<<'...end parser.y/module_eval...', 'parser.y', 1317)
+module_eval(<<'...end parser.y/module_eval...', 'parser.y', 1318)
 
 def assert_at(file,line, message = "")
@@ -43,59 +43,4 @@
 end
 
-
-###----------/* keywords */ --------------------------------------------- 
-### @@adl_reserved = {
-###     'archetype' => :SYM_ARCHETYPE,
-###     'adl_version' => :SYM_ADL_VERSION,
-###     'controlled' => :SYM_IS_CONTROLLED,
-###     'specialize' => :SYM_SPECIALIZE,
-###     'concept' => :SYM_CONCEPT,
-###     'language' => :SYM_LANGUAGE,
-###     'description' => :SYM_DESCRIPTION,
-###     'definition' => :SYM_DEFINITION,
-###     'invariant' => :SYM_INVARIANT,
-###     'ontology' => :SYM_ONTOLOGY,
-###     'matches' => :SYM_MATCHES,
-###     'is_in' => :SYM_MATCHES,
-###     'occurrences' => :SYM_OCCURRENCES,
-###     'true' => :SYM_TRUE, #[Tt][Rr][Uu][Ee] -- -> SYM_TRUE 
-###     'false' => :SYM_FALSE, # [Ff][Aa][Ll][Ss][Ee] -- -> SYM_FALSE 
-###     'infinity' => :SYM_INFINITY # [Ii][Nn][Ff][Ii][Nn][Ii][Tt][Yy] -- -> SYM_INFINITY 
-### }
-
-### @@dadl_reserved = {
-###   'true' => :SYM_TRUE, #[Tt][Rr][Uu][Ee] -- -> SYM_TRUE 
-###   'false' => :SYM_FALSE, # [Ff][Aa][Ll][Ss][Ee] -- -> SYM_FALSE 
-###   'infinity' => :SYM_INFINITY # [Ii][Nn][Ff][Ii][Nn][Ii][Tt][Yy] -- -> SYM_INFINITY 
-### }
-
-### @@cadl_reserved = {
-###   'then' => :SYM_THEN, # [Tt][Hh][Ee][Nn]
-###   'else' => :SYM_ELSE, # [Ee][Ll][Ss][Ee]
-###   'and' => :SYM_AND, # [Aa][Nn][Dd]
-###   'or' => :SYM_OR, # [Oo][Rr]
-###   'xor' => :SYM_XOR, # [Xx][Oo][Rr]
-###   'not' => :SYM_NOT, # [Nn][Oo][Tt]
-###   'implies' => :SYM_IMPLIES, # [Ii][Mm][Pp][Ll][Ii][Ee][Ss]
-###   'true' => :SYM_TRUE, #[Tt][Rr][Uu][Ee] -- -> SYM_TRUE 
-###   'false' => :SYM_FALSE, # [Ff][Aa][Ll][Ss][Ee] -- -> SYM_FALSE 
-###   'forall' => :SYM_FORALL, # [Ff][Oo][Rr][_][Aa][Ll][Ll]
-###   'exists' => :SYM_EXISTS, # [Ee][Xx][Ii][Ss][Tt][Ss]
-###   'existence' => :SYM_EXISTENCE, # [Ee][Xx][Iu][Ss][Tt][Ee][Nn][Cc][Ee]
-###   'occurrences' => :SYM_OCCURRENCES, # [Oo][Cc][Cc][Uu][Rr][Rr][Ee][Nn][Cc][Ee][Ss]
-###   'cardinality' => :SYM_CARDINALITY, # [Cc][Aa][Rr][Dd][Ii][Nn][Aa][Ll][Ii][Tt][Yy]
-###   'ordered' => :SYM_ORDERED, # [Oo][Rr][Dd][Ee][Rr][Ee][Dd]
-###   'unordered' => :SYM_UNORDERED, # [Uu][Nn][Oo][Rr][Dd][Ee][Rr][Ee][Dd]
-###   'unique' => :SYM_UNIQUE, # [Uu][Nn][Ii][Qq][Uu][Ee]
-###   'matches' => :SYM_MATCHES, # [Mm][Aa][Tt][Cc][Hh][Ee][Ss]
-###   'is_in' => :SYM_MATCHES, # [Ii][Ss][_][Ii][Nn]
-###   'invariant' => :SYM_INVARIANT, # [Ii][Nn][Vv][Aa][Rr][Ii][Aa][Nn][Tt]
-###   'infinity' => :SYM_INFINITY, # [Ii][Nn][Ff][Ii][Nn][Ii][Tt][Yy] -- -> SYM_INFINITY 
-###   'use_node' => :SYM_USE_NODE, # [Uu][Ss][Ee][_][Nn][Oo][Dd][Ee]
-###   'use_archetype' => :SYM_ALLOW_ARCHETYPE, # [Uu][Ss][Ee][_][Aa][Rr][Cc][Hh][Ee][Tt][Yy][Pp][Ee]
-###   'allow_archetype' => :SYM_ALLOW_ARCHETYPE, # [Aa][Ll][Ll][Oo][Ww][_][Aa][Rr][Cc][Hh][Ee][Tt][Yy][Pp][Ee]
-###   'include' => :SYM_INCLUDE, # [Ii][Nn][Cc][Ll][Uu][Dd][Ee]
-###   'exclude' => :SYM_EXCLUDE # [Ee][Xx][Cc][Ll][Uu][Dd][Ee]
-### }
 
 
@@ -152,80 +97,80 @@
 
 racc_action_table = [
-   514,   493,   133,   466,   164,   588,   464,   460,   129,   462,
-    57,   374,   228,   327,   475,    10,   568,   169,   170,   167,
-   168,   433,    29,   109,   511,   183,   108,   508,   524,   415,
-   509,   510,    71,   431,    66,    12,   537,   512,    49,   515,
-   517,   314,   569,    59,   491,   229,    95,    98,   567,   134,
-    30,    46,    47,   309,    49,   571,    78,    81,    84,   187,
+   569,   433,   472,   466,    10,   588,   464,   460,   228,   462,
+   129,   477,   568,   571,   475,   212,     1,   374,   333,    57,
+    29,   493,   330,   388,    12,   380,   381,   431,   524,    93,
+   114,   183,    71,   112,   478,     5,   537,   512,   213,   515,
+   517,   229,   514,   511,   567,    59,   508,    49,    30,   509,
+   510,    46,    47,   309,   491,   127,    78,    81,    84,   187,
    117,    93,   295,   301,    75,   109,   112,   114,   117,   532,
    524,   117,   109,   114,    71,   112,   123,   124,   537,   512,
-   117,   515,   517,   117,   101,   109,   307,   270,   271,   534,
-   161,   114,   283,    46,    47,   309,    71,   230,    78,    81,
-    84,   187,   114,    93,   295,   301,    99,   109,   112,   114,
-   117,   532,   152,    66,   373,    46,    47,   101,   477,   142,
-    78,    81,    84,   429,   117,    93,    95,    98,   307,   270,
-   271,   534,   489,    49,   283,    88,    91,   152,   487,   139,
-   152,   478,    76,   156,   157,   152,   217,   148,   155,   472,
-   151,   153,   152,    78,    81,    84,   236,   158,    93,    95,
-    98,   114,   159,   152,   143,   150,   456,   152,    88,    91,
-   156,   157,   458,   155,   148,    76,   155,   151,   153,   152,
-   112,   155,    78,    81,    84,   147,   149,    93,   155,   112,
-   150,   152,   594,   150,   109,   236,   183,   577,   150,   155,
-   166,   330,   127,   155,    76,   150,   576,   447,   154,   565,
-   147,   149,   112,   147,   149,   155,   150,  -373,   147,   149,
-   150,   217,    78,   376,   377,   147,   149,   155,   448,   380,
-   381,   217,   150,    93,   371,   154,   147,   149,   112,   258,
-   147,   149,   250,   212,   150,   254,   255,   117,    78,   376,
-   377,    35,   147,   149,    78,   376,   377,    78,    81,    84,
-    46,    47,    93,   101,   147,   149,   213,    78,    81,    84,
-   265,   109,    93,   144,   126,   564,   380,   381,   145,    76,
-    93,   101,   237,    49,    20,   139,    78,    81,    84,    76,
-   217,    93,    46,    47,   495,   109,   112,   114,   117,    78,
-    81,    84,    21,    99,    93,    95,    98,    16,   101,    17,
-     1,   324,    46,    47,    88,    91,   217,    78,    81,    84,
-   126,    76,    93,    95,    98,   319,    78,    81,    84,     5,
-   139,    93,    88,    91,   217,   169,   170,   167,   168,    76,
-   217,    78,   376,   377,    78,    81,    84,   217,    76,    93,
-    95,    98,    78,    81,    84,   209,   333,    93,   217,    88,
-    91,   496,   171,   380,   381,    35,    76,    93,   114,   310,
-    78,    81,    84,   102,    76,    93,    78,    81,    84,  -374,
-   390,    93,   101,    78,    81,    84,   380,   381,    93,    16,
-    93,    17,    76,    54,    78,    81,    84,    49,    76,    93,
-   101,   424,   425,    35,   139,    76,    46,    47,   391,   380,
-   381,    39,   392,    93,    46,    47,    76,   393,    78,    81,
-    84,    35,    99,    93,    95,    98,   380,   381,   101,   394,
-    93,    46,    47,    88,    91,    49,    78,    81,    84,   411,
-    76,    93,    95,    98,    46,    47,   101,   416,   417,   102,
-    99,    88,    91,    49,    78,   376,   377,   395,    76,    46,
-    47,   396,    46,    47,    78,    81,    84,   397,    99,    93,
-    95,    98,   398,   373,   101,   470,   399,    46,    47,    88,
-    91,   400,    78,    81,    84,   262,    76,    93,    95,    98,
-    46,    47,   101,   386,   322,   385,    99,    88,    91,   401,
-   217,   123,   124,   402,    76,    46,    47,   411,   422,   423,
-    78,    81,    84,   264,   139,    93,    95,    98,   101,   614,
-   615,   616,   410,   376,   377,    88,    91,   265,    78,    81,
-    84,   411,    76,    93,    95,    98,    78,    81,    84,   268,
-   139,    93,   101,    88,    91,   266,   410,   376,   377,   403,
-    76,   217,   418,   419,    78,    81,    84,   404,    76,    93,
-    95,    98,   420,   421,   139,   217,    78,   376,   377,    88,
-    91,   388,   405,   380,   381,   316,    76,    93,    78,    81,
-    84,   426,   427,    93,    95,    98,   408,    78,    81,    84,
-    46,    47,    93,    88,    91,   169,   170,   167,   168,   269,
-    76,    78,    81,    84,   335,   336,    93,   309,   268,    76,
-    78,    81,    84,   187,   267,    93,   295,   301,   266,   109,
-   112,   114,   117,    76,    78,    81,    84,   314,   316,    93,
-    78,   376,   377,   109,   112,   114,   117,    78,   376,   377,
-   307,   270,   271,  -104,   343,   344,   283,   202,   345,   346,
-    78,    81,    84,   187,   265,    93,   123,   124,   126,   109,
-   112,   114,   117,   183,   120,   127,   347,   348,    78,    81,
-    84,    25,    26,    93,   123,   124,   126,   109,   112,   114,
-   117,   264,   120,    78,    81,    84,   596,   597,    93,    78,
-   376,   377,   109,   112,   114,   117,    78,    81,    84,   361,
-   362,    93,   363,   364,   263,   109,   112,   114,   117,    78,
-    81,    84,   123,   124,    93,   624,   625,   262,   109,   112,
-   114,   117,   383,    78,   376,   377,   169,   170,   167,   168,
-   169,   170,   167,   168,   169,   170,   167,   168,   169,   170,
-   167,   168,   261,   260,   259,   248,   434,   435,   436,   437,
-   438,   439,   440,   441,   442,   443,   444,   445,   247,   246,
+   117,   515,   517,   314,   101,   114,   307,   270,   271,   534,
+   161,   458,   283,    46,    47,   309,    71,   230,    78,    81,
+    84,   187,   117,    93,   295,   301,    99,   109,   112,   114,
+   117,   532,   114,   565,   448,    46,    47,   101,   158,   373,
+    78,    81,    84,   159,   429,    93,    95,    98,   307,   270,
+   271,   534,   594,    20,   283,    88,    91,   156,   157,   139,
+   415,   148,    76,   456,   152,   153,   142,   489,   380,   381,
+   236,    21,    93,    78,    81,    84,   217,   117,    93,    95,
+    98,   487,   380,   381,    46,    47,    93,   164,    88,    91,
+   155,   258,   156,   157,   250,    76,   148,   254,   255,   152,
+   153,   112,   373,   102,   470,   114,   150,   151,    78,   376,
+   377,   143,    78,    81,    84,   217,   109,    93,   495,    78,
+   376,   377,   154,   217,   112,   155,    39,   147,   149,    95,
+    98,   183,   133,   101,    76,   112,    35,   109,    78,    81,
+    84,   150,   151,    93,    46,    47,   109,   109,   112,   114,
+   117,    78,    81,    84,   496,   139,    93,   154,   101,    78,
+    81,    84,   147,   149,    93,    78,   376,   377,    49,    78,
+    81,    84,    66,    76,    93,    95,    98,    46,    47,   134,
+   139,    76,   101,   327,    88,    91,   126,    16,   447,    17,
+   217,    76,    49,   109,    78,    81,    84,   319,   371,    93,
+    95,    98,   380,   381,    99,   217,    93,   209,   310,    88,
+    91,   117,   324,    46,    47,   217,    76,    35,    78,    81,
+    84,   126,   108,    93,    95,    98,    78,    81,    84,   217,
+    66,    93,   390,    88,    91,    78,   376,   377,   101,   391,
+    76,    78,    81,    84,   102,   166,    93,   171,    76,    49,
+    49,    78,    81,    84,   392,   386,    93,   385,    46,    47,
+   139,   101,  -373,    76,  -374,    78,    81,    84,   577,   217,
+    93,   393,    54,    76,    78,    81,    84,   576,   394,    93,
+    95,    98,    35,    99,   217,    46,    47,    76,   395,    88,
+    91,   396,    46,    47,   217,   265,    76,    78,    81,    84,
+   564,   397,    93,    95,    98,    78,    81,    84,   217,    35,
+    93,   144,    88,    91,    49,   398,   145,   101,   399,    76,
+    78,    81,    84,    46,    47,    93,    16,    76,    17,   322,
+    78,    81,    84,   400,   237,    93,   123,   124,   262,   139,
+   101,    49,    76,   401,    78,    81,    84,   418,   419,    93,
+    46,    47,    76,    78,    81,    84,    46,    47,    93,    95,
+    98,   402,    99,   101,   416,   417,    76,   264,    88,    91,
+   265,    46,    47,    25,    26,    76,    78,    81,    84,   268,
+   155,    93,    95,    98,   266,    99,   101,   169,   170,   167,
+   168,    88,    91,   403,    46,    47,   150,   151,    76,    78,
+    81,    84,   314,   316,    93,    95,    98,   404,   139,   101,
+   420,   421,   380,   381,    88,    91,    93,   147,   149,   155,
+   405,    76,    78,    81,    84,   422,   423,    93,    95,    98,
+   316,    99,   101,   335,   336,   150,   151,    88,    91,   408,
+    46,    47,   236,   269,    76,    78,    81,    84,   155,   268,
+    93,    95,    98,   267,   139,   217,   147,   149,   424,   425,
+    88,    91,   155,   266,   150,   151,   265,    76,    78,    81,
+    84,   343,   344,    93,    95,    98,   380,   381,   150,   151,
+    93,   155,   264,    88,    91,   147,   149,   155,   345,   346,
+    76,    78,    81,    84,   347,   348,    93,   150,   151,   147,
+   149,   263,   309,   150,   151,    78,    81,    84,   187,   262,
+    93,   295,   301,    76,   109,   112,   114,   117,   147,   149,
+   596,   597,   155,   261,   147,   149,   260,   411,   380,   381,
+   411,   259,    93,   411,   248,   307,   270,   271,   150,   151,
+   434,   283,   410,   376,   377,    78,   376,   377,   410,   376,
+   377,   614,   615,   616,  -104,    78,   376,   377,   202,   147,
+   149,    78,    81,    84,   187,   435,    93,   123,   124,   126,
+   109,   112,   114,   117,   183,   120,   127,   123,   124,    78,
+    81,    84,   361,   362,    93,   123,   124,   126,   109,   112,
+   114,   117,   436,   120,    78,    81,    84,   363,   364,    93,
+    78,   376,   377,   109,   112,   114,   117,    78,    81,    84,
+   426,   427,    93,    78,   376,   377,   109,   112,   114,   117,
+    78,    81,    84,   624,   625,    93,    78,   376,   377,   109,
+   112,   114,   117,    78,    81,    84,   437,   438,    93,   439,
+   440,   441,   109,   112,   114,   117,   169,   170,   167,   168,
+   169,   170,   167,   168,   169,   170,   167,   168,   383,    78,
+   376,   377,   169,   170,   167,   168,   169,   170,   167,   168,
+   169,   170,   167,   168,   442,   443,   444,   445,   247,   246,
    450,   451,   452,   453,   454,   455,   144,   158,   145,   159,
    245,   244,   243,   242,   241,   240,   468,   239,   471,   238,
@@ -243,80 +188,80 @@
 
 racc_action_check = [
-   477,   423,    68,   396,    91,   563,   395,   393,    60,   394,
-    40,   261,   161,   243,   401,     5,   525,   234,   234,   234,
-   234,   348,    23,   243,   468,   261,    58,   468,   477,   336,
-   468,   468,   477,   346,    58,     5,   477,   477,    40,   477,
-   477,   477,   529,    60,   421,   161,    91,    91,   525,    68,
-    23,   477,   477,   477,    58,   529,   477,   477,   477,   477,
-   423,   477,   477,   477,    53,   477,   477,   477,   477,   477,
-   529,   396,   393,   395,   529,   394,   401,   401,   529,   529,
-   348,   529,   529,   468,    53,   336,   477,   477,   477,   477,
-   563,   346,   477,   529,   529,   529,    53,   165,   529,   529,
-   529,   529,   421,   529,   529,   529,    53,   529,   529,   529,
-   529,   529,   226,    48,   260,    53,    53,   165,   404,    80,
-    53,    53,    53,   344,   246,    53,    53,    53,   529,   529,
-   529,   529,   419,    48,   529,    53,    53,   227,   417,   165,
-   172,   404,    53,   172,   172,   224,   149,   172,   226,   400,
-   172,   172,   223,   165,   165,   165,   172,    84,   165,   165,
-   165,   244,    84,   218,    80,   226,   390,    83,   165,   165,
-    83,    83,   392,   227,    83,   165,   172,    83,    83,   318,
-   344,   224,   149,   149,   149,   226,   226,   149,   223,   419,
-   227,   221,   568,   172,   417,   318,   263,   539,   224,   218,
-    94,   245,   400,    83,   149,   223,   539,   362,   172,   517,
-   227,   227,   245,   172,   172,   318,   218,    94,   224,   224,
-    83,   153,   390,   390,   390,   223,   223,   221,   364,   392,
-   392,   152,   318,   392,   259,    83,   218,   218,   242,   187,
-    83,    83,   187,   142,   221,   187,   187,   259,   568,   568,
-   568,   512,   318,   318,   362,   362,   362,   153,   153,   153,
-   517,   517,   153,   170,   221,   221,   142,   152,   152,   152,
-   516,   240,   152,    81,   238,   516,   364,   364,    81,   153,
-   364,   611,   173,   512,    13,   170,   187,   187,   187,   152,
-   151,   187,   512,   512,   425,   187,   187,   187,   187,   170,
-   170,   170,    13,   611,   170,   170,   170,    26,   168,    26,
-     0,   241,   611,   611,   170,   170,   150,   611,   611,   611,
-   241,   170,   611,   611,   611,   229,   151,   151,   151,     0,
-   168,   151,   611,   611,   156,   173,   173,   173,   173,   611,
-   157,   425,   425,   425,   168,   168,   168,   148,   151,   168,
-   168,   168,   150,   150,   150,   135,   247,   150,   147,   168,
-   168,   427,    99,   496,   496,   135,   168,   496,   247,   213,
-   156,   156,   156,    56,   150,   156,   157,   157,   157,    99,
-   272,   157,   164,   148,   148,   148,   264,   264,   148,    12,
-   264,    12,   156,    34,   147,   147,   147,   135,   157,   147,
-   612,   341,   341,    34,   164,   148,   135,   135,   273,   427,
-   427,    28,   275,   427,    56,    56,   147,   278,   164,   164,
-   164,    28,   612,   164,   164,   164,   448,   448,    79,   281,
-   448,   612,   612,   164,   164,    34,   612,   612,   612,   482,
-   164,   612,   612,   612,    34,    34,   605,   337,   337,   131,
-    79,   612,   612,    28,   482,   482,   482,   285,   612,    79,
-    79,   288,    28,    28,    79,    79,    79,   291,   605,    79,
-    79,    79,   293,   398,   617,   398,   295,   605,   605,    79,
-    79,   296,   605,   605,   605,   298,    79,   605,   605,   605,
-   131,   131,   169,   266,   239,   266,   617,   605,   605,   300,
-   217,   239,   239,   301,   605,   617,   617,   319,   340,   340,
-   617,   617,   617,   303,   169,   617,   617,   617,   167,   609,
-   609,   609,   319,   319,   319,   617,   617,   304,   169,   169,
-   169,   578,   617,   169,   169,   169,   217,   217,   217,   308,
-   167,   217,   101,   169,   169,   309,   578,   578,   578,   310,
-   169,   155,   338,   338,   167,   167,   167,   311,   217,   167,
-   167,   167,   339,   339,   101,   154,   495,   495,   495,   167,
-   167,   268,   312,   268,   268,   315,   167,   268,   101,   101,
-   101,   342,   342,   101,   101,   101,   316,   155,   155,   155,
-   515,   515,   155,   101,   101,   235,   235,   235,   235,   211,
-   101,   154,   154,   154,   249,   249,   154,   212,   205,   155,
-   212,   212,   212,   212,   204,   212,   212,   212,   202,   212,
-   212,   212,   212,   154,   258,   258,   258,   215,   215,   258,
-   447,   447,   447,   258,   258,   258,   258,   262,   262,   262,
-   212,   212,   212,   102,   251,   251,   212,   102,   252,   252,
-   102,   102,   102,   102,   201,   102,   102,   102,   102,   102,
-   102,   102,   102,   102,   102,    59,   253,   253,    59,    59,
-    59,    18,    18,    59,    59,    59,    59,    59,    59,    59,
-    59,   200,    59,   254,   254,   254,   572,   572,   254,   567,
-   567,   567,   254,   254,   254,   254,   250,   250,   250,   256,
-   256,   250,   257,   257,   198,   250,   250,   250,   250,   255,
-   255,   255,   267,   267,   255,   621,   621,   197,   255,   255,
-   255,   255,   265,   265,   265,   265,    96,    96,    96,    96,
-   233,   233,   233,   233,   232,   232,   232,   232,   231,   231,
-   231,   231,   195,   194,   189,   186,   349,   350,   351,   352,
-   353,   354,   355,   356,   357,   358,   359,   360,   185,   184,
+   529,   348,   400,   396,     5,   563,   395,   393,   161,   394,
+    60,   404,   525,   529,   401,   142,     0,   261,   247,    40,
+    23,   423,   245,   268,     5,   268,   268,   346,   529,   268,
+   247,   261,   529,   245,   404,     0,   529,   529,   142,   529,
+   529,   161,   477,   468,   525,    60,   468,    40,    23,   468,
+   468,   529,   529,   529,   421,   400,   529,   529,   529,   529,
+   348,   529,   529,   529,    53,   529,   529,   529,   529,   529,
+   477,   396,   393,   395,   477,   394,   401,   401,   477,   477,
+   423,   477,   477,   477,    53,   346,   529,   529,   529,   529,
+   563,   392,   529,   477,   477,   477,    53,   165,   477,   477,
+   477,   477,   468,   477,   477,   477,    53,   477,   477,   477,
+   477,   477,   421,   517,   364,    53,    53,   165,    84,   260,
+    53,    53,    53,    84,   344,    53,    53,    53,   477,   477,
+   477,   477,   568,    13,   477,    53,    53,   172,   172,   165,
+   336,   172,    53,   390,   172,   172,    80,   419,   392,   392,
+   172,    13,   392,   165,   165,   165,   148,   246,   165,   165,
+   165,   417,   364,   364,   517,   517,   364,    91,   165,   165,
+   172,   187,    83,    83,   187,   165,    83,   187,   187,    83,
+    83,   344,   398,    56,   398,   244,   172,   172,   568,   568,
+   568,    80,   148,   148,   148,   153,   336,   148,   425,   390,
+   390,   390,   172,   152,   419,    83,    28,   172,   172,    91,
+    91,   263,    68,   168,   148,   242,    28,   417,   187,   187,
+   187,    83,    83,   187,    56,    56,   240,   187,   187,   187,
+   187,   153,   153,   153,   427,   168,   153,    83,   170,   152,
+   152,   152,    83,    83,   152,   425,   425,   425,    28,   168,
+   168,   168,    48,   153,   168,   168,   168,    28,    28,    68,
+   170,   152,   611,   243,   168,   168,   238,    12,   362,    12,
+   150,   168,    48,   243,   170,   170,   170,   229,   259,   170,
+   170,   170,   427,   427,   611,   149,   427,   135,   213,   170,
+   170,   259,   241,   611,   611,   154,   170,   135,   611,   611,
+   611,   241,    58,   611,   611,   611,   150,   150,   150,   147,
+    58,   150,   272,   611,   611,   362,   362,   362,   169,   273,
+   611,   149,   149,   149,   131,    94,   149,    99,   150,   135,
+    58,   154,   154,   154,   275,   266,   154,   266,   135,   135,
+   169,   612,    94,   149,    99,   147,   147,   147,   539,   155,
+   147,   278,    34,   154,   169,   169,   169,   539,   281,   169,
+   169,   169,    34,   612,   217,   131,   131,   147,   285,   169,
+   169,   288,   612,   612,   156,   516,   169,   612,   612,   612,
+   516,   291,   612,   612,   612,   155,   155,   155,   157,   512,
+   155,    81,   612,   612,    34,   293,    81,   101,   295,   612,
+   217,   217,   217,    34,    34,   217,    26,   155,    26,   239,
+   156,   156,   156,   296,   173,   156,   239,   239,   298,   101,
+   617,   512,   217,   300,   157,   157,   157,   338,   338,   157,
+   512,   512,   156,   101,   101,   101,   515,   515,   101,   101,
+   101,   301,   617,    79,   337,   337,   157,   303,   101,   101,
+   304,   617,   617,    18,    18,   101,   617,   617,   617,   308,
+   218,   617,   617,   617,   309,    79,   164,   173,   173,   173,
+   173,   617,   617,   310,    79,    79,   218,   218,   617,    79,
+    79,    79,   215,   215,    79,    79,    79,   311,   164,   605,
+   339,   339,   496,   496,    79,    79,   496,   218,   218,   223,
+   312,    79,   164,   164,   164,   340,   340,   164,   164,   164,
+   315,   605,   167,   249,   249,   223,   223,   164,   164,   316,
+   605,   605,   318,   211,   164,   605,   605,   605,   222,   205,
+   605,   605,   605,   204,   167,   151,   223,   223,   341,   341,
+   605,   605,   318,   202,   222,   222,   201,   605,   167,   167,
+   167,   251,   251,   167,   167,   167,   448,   448,   318,   318,
+   448,   226,   200,   167,   167,   222,   222,   227,   252,   252,
+   167,   151,   151,   151,   253,   253,   151,   226,   226,   318,
+   318,   198,   212,   227,   227,   212,   212,   212,   212,   197,
+   212,   212,   212,   151,   212,   212,   212,   212,   226,   226,
+   572,   572,   224,   195,   227,   227,   194,   578,   264,   264,
+   482,   189,   264,   319,   186,   212,   212,   212,   224,   224,
+   349,   212,   578,   578,   578,   482,   482,   482,   319,   319,
+   319,   609,   609,   609,   102,   495,   495,   495,   102,   224,
+   224,   102,   102,   102,   102,   350,   102,   102,   102,   102,
+   102,   102,   102,   102,   102,   102,    59,   267,   267,    59,
+    59,    59,   256,   256,    59,    59,    59,    59,    59,    59,
+    59,    59,   351,    59,   254,   254,   254,   257,   257,   254,
+   447,   447,   447,   254,   254,   254,   254,   250,   250,   250,
+   342,   342,   250,   262,   262,   262,   250,   250,   250,   250,
+   255,   255,   255,   621,   621,   255,   567,   567,   567,   255,
+   255,   255,   255,   258,   258,   258,   352,   353,   258,   354,
+   355,   356,   258,   258,   258,   258,    96,    96,    96,    96,
+   235,   235,   235,   235,   234,   234,   234,   234,   265,   265,
+   265,   265,   231,   231,   231,   231,   232,   232,   232,   232,
+   233,   233,   233,   233,   357,   358,   359,   360,   185,   184,
    365,   366,   367,   368,   369,   370,   376,   377,   380,   381,
    182,   181,   180,   179,   178,   177,   397,   175,   399,   174,
@@ -334,67 +279,67 @@
 
 racc_action_pointer = [
-   309,   nil,   862,   876,   857,    14,   847,   nil,   872,   nil,
-   nil,   nil,   365,   283,   834,   nil,   851,   nil,   649,   nil,
-   nil,   nil,   828,    21,   832,   nil,   283,   823,   410,   nil,
-   nil,   nil,   nil,   812,   392,   791,   nil,   nil,   832,   nil,
-    -5,   nil,   nil,   nil,   789,   826,   nil,   nil,    90,   835,
-   nil,   nil,   788,    63,   nil,   nil,   362,   nil,    11,   611,
-    -7,   nil,   825,   nil,   nil,   nil,   779,   nil,     1,   772,
-   nil,   776,   nil,   nil,   nil,   nil,   763,   nil,   nil,   407,
-    85,   216,   771,   161,   100,   nil,   717,   nil,   723,   nil,
-   nil,   -17,   748,   nil,   171,   nil,   651,   nil,   nil,   333,
-   nil,   521,   593,   nil,   nil,   nil,   782,   nil,   nil,   nil,
+    15,   nil,   862,   876,   857,     3,   847,   nil,   872,   nil,
+   nil,   nil,   243,   132,   834,   nil,   851,   nil,   431,   nil,
+   nil,   nil,   828,    19,   832,   nil,   382,   823,   205,   nil,
+   nil,   nil,   nil,   812,   351,   791,   nil,   nil,   832,   nil,
+     4,   nil,   nil,   nil,   789,   826,   nil,   nil,   229,   835,
+   nil,   nil,   788,    63,   nil,   nil,   172,   nil,   287,   602,
+    -5,   nil,   825,   nil,   nil,   nil,   779,   nil,   211,   772,
+   nil,   776,   nil,   nil,   nil,   nil,   763,   nil,   nil,   422,
+   112,   334,   771,   163,    61,   nil,   717,   nil,   723,   nil,
+   nil,   146,   748,   nil,   296,   nil,   651,   nil,   nil,   298,
+   nil,   376,   584,   nil,   nil,   nil,   782,   nil,   nil,   nil,
    nil,   741,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
-   nil,   438,   nil,   nil,   nil,   354,   nil,   756,   711,   760,
-   nil,   nil,   231,   739,   nil,   nil,   768,   337,   326,   125,
-   295,   269,   210,   200,   544,   530,   313,   319,   nil,   nil,
-   nil,    11,   nil,   nil,   361,    96,   nil,   497,   287,   471,
-   242,   nil,   134,   260,   724,   722,   nil,   720,   719,   718,
-   717,   716,   715,   nil,   704,   703,   730,   229,   nil,   689,
-   nil,   nil,   nil,   nil,   688,   687,   nil,   662,   649,   nil,
-   626,   599,   563,   nil,   559,   553,   nil,   nil,   nil,   nil,
-   nil,   563,   553,   333,   nil,   585,   nil,   479,   157,   nil,
-   nil,   185,   nil,   146,   139,   nil,   106,   131,   nil,   313,
-   nil,   663,   659,   655,   -58,   520,   nil,   nil,   209,   438,
-   205,   255,   171,   -43,    93,   145,    55,   300,   nil,   544,
-   639,   584,   588,   606,   626,   652,   639,   642,   567,   178,
-    60,   -45,   580,   126,   328,   666,   439,   649,   515,   nil,
-   nil,   nil,   357,   394,   nil,   389,   nil,   nil,   394,   nil,
-   nil,   406,   nil,   nil,   nil,   434,   nil,   nil,   438,   nil,
-   nil,   388,   nil,   417,   nil,   421,   458,   nil,   430,   nil,
-   476,   448,   nil,   458,   472,   nil,   nil,   nil,   484,   490,
-   535,   523,   558,   nil,   nil,   532,   505,   nil,   173,   465,
+   nil,   313,   nil,   nil,   nil,   286,   nil,   756,   711,   760,
+   nil,   nil,     3,   739,   nil,   nil,   768,   288,   135,   264,
+   249,   514,   182,   174,   274,   328,   353,   367,   nil,   nil,
+   nil,     7,   nil,   nil,   445,    96,   nil,   491,   192,   297,
+   217,   nil,   128,   392,   724,   722,   nil,   720,   719,   718,
+   717,   716,   715,   nil,   704,   703,   599,   161,   nil,   556,
+   nil,   nil,   nil,   nil,   551,   548,   nil,   534,   526,   nil,
+   507,   491,   488,   nil,   478,   474,   nil,   nil,   nil,   nil,
+   nil,   487,   528,   252,   nil,   440,   nil,   343,   418,   nil,
+   nil,   nil,   486,   457,   560,   nil,   519,   525,   nil,   265,
+   nil,   667,   671,   675,   659,   655,   nil,   nil,   201,   353,
+   160,   236,   148,   207,   117,   -34,    88,   -38,   nil,   453,
+   630,   491,   508,   514,   617,   643,   602,   617,   656,   222,
+    65,   -39,   636,   141,   550,   682,   281,   594,   -33,   nil,
+   nil,   nil,   289,   305,   nil,   311,   nil,   nil,   328,   nil,
+   nil,   335,   nil,   nil,   nil,   345,   nil,   nil,   348,   nil,
+   nil,   302,   nil,   340,   nil,   343,   390,   nil,   363,   nil,
+   400,   386,   nil,   392,   395,   nil,   nil,   nil,   404,   409,
+   459,   453,   486,   nil,   nil,   467,   438,   nil,   500,   571,
    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
-   nil,   nil,   nil,   nil,   nil,   nil,    19,   387,   492,   502,
-   448,   341,   521,   nil,   113,   nil,    23,   nil,    11,   686,
-   687,   688,   689,   690,   691,   692,   693,   694,   695,   696,
-   697,   nil,   197,   nil,   218,   700,   701,   702,   703,   704,
+   nil,   nil,   nil,   nil,   nil,   nil,   130,   384,   367,   430,
+   445,   478,   630,   nil,   114,   nil,    17,   nil,    -9,   560,
+   585,   612,   656,   657,   659,   660,   661,   694,   695,   696,
+   697,   nil,   258,   nil,   104,   700,   701,   702,   703,   704,
    705,   nil,   nil,   nil,   nil,   nil,   709,   710,   nil,   nil,
    706,   707,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
-   165,   nil,   171,     6,     8,     5,     2,   716,   419,   714,
-   148,    13,   718,   nil,   106,   nil,   nil,   701,   750,   nil,
-   724,   nil,   nil,   772,   727,   722,   nil,   128,   nil,   122,
-   nil,    34,   nil,    -9,   nil,   284,   nil,   351,   735,   729,
+   142,   nil,    90,     6,     8,     5,     2,   716,   128,   714,
+     1,    13,   718,   nil,    -1,   nil,   nil,   701,   750,   nil,
+   724,   nil,   nil,   772,   727,   722,   nil,   151,   nil,   137,
+   nil,    44,   nil,    11,   nil,   188,   nil,   224,   735,   729,
    737,   730,   739,   731,   nil,   nil,   nil,   nil,   nil,   nil,
-   nil,   nil,   nil,   nil,   nil,   nil,   741,   573,   368,   744,
+   nil,   nil,   nil,   nil,   nil,   nil,   741,   623,   498,   744,
    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
-   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,    14,   nil,
-   nil,   nil,   nil,   nil,   nil,   nil,   nil,    -1,   771,   nil,
-   774,   797,   397,   nil,   nil,   751,   752,   747,   754,   748,
-   756,   749,   758,   750,   760,   509,   305,   763,   nil,   764,
+   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,    33,   nil,
+   nil,   nil,   nil,   nil,   nil,   nil,   nil,    41,   771,   nil,
+   774,   797,   568,   nil,   nil,   751,   752,   747,   754,   748,
+   756,   749,   758,   750,   760,   578,   434,   763,   nil,   764,
    nil,   765,   nil,   766,   nil,   767,   768,   nil,   760,   761,
-   762,   763,   240,   nil,   820,   538,   215,   208,   809,   nil,
-   nil,   nil,   nil,   nil,   nil,    -7,   nil,   nil,   nil,    41,
-   nil,   nil,   nil,   nil,   792,   808,   nil,   nil,   757,   183,
+   762,   763,   378,   nil,   820,   384,   320,   112,   809,   nil,
+   nil,   nil,   nil,   nil,   nil,   -11,   nil,   nil,   nil,    -1,
+   nil,   nil,   nil,   nil,   792,   808,   nil,   nil,   757,   334,
    833,   789,   nil,   nil,   nil,   787,   nil,   788,   nil,   789,
    nil,   790,   nil,   791,   792,   nil,   nil,   nil,   nil,   nil,
-   nil,   814,   nil,     4,   785,   nil,   827,   632,   191,   nil,
-   nil,   nil,   595,   nil,   848,   nil,   807,   nil,   489,   802,
+   nil,   814,   nil,     4,   785,   nil,   827,   649,   131,   nil,
+   nil,   nil,   509,   nil,   848,   nil,   807,   nil,   565,   802,
    850,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   786,
    nil,   nil,   nil,   806,   nil,   nil,   nil,   nil,   823,   854,
-   855,   847,   814,   nil,   nil,   425,   828,   nil,   nil,   436,
-   nil,   260,   379,   863,   855,   856,   857,   453,   nil,   797,
-   798,   632,   nil,   nil,   nil,   nil ]
+   855,   847,   814,   nil,   nil,   468,   828,   nil,   nil,   548,
+   nil,   241,   320,   863,   855,   856,   857,   399,   nil,   797,
+   798,   620,   nil,   nil,   nil,   nil ]
 
 racc_action_default = [
@@ -421,5 +366,5 @@
   -134,  -123,  -149,  -146,  -135,  -124,  -115,  -108,  -107,   -87,
    -86,  -376,  -376,  -376,  -287,  -376,  -276,  -376,  -263,  -277,
-  -274,  -264,  -273,  -265,  -260,  -275,  -261,  -262,  -307,  -376,
+  -273,  -274,  -264,  -265,  -260,  -275,  -261,  -262,  -307,  -376,
   -253,  -251,  -268,  -269,  -266,  -267,  -278,  -270,  -376,  -376,
   -376,  -376,  -376,  -376,  -376,  -376,  -376,  -376,  -116,  -376,
@@ -466,17 +411,17 @@
     79,   140,   125,   162,    45,    51,   160,   203,   128,   313,
     45,    55,   110,   413,   473,   121,   195,   317,   107,   103,
-   520,    63,   111,    64,    65,    61,    19,     3,   407,    94,
-   113,   119,   106,   172,    65,   173,    58,   529,   118,   273,
-    32,   130,   132,   613,   216,   201,   219,   220,   606,   222,
+   173,    63,   111,    65,   172,    19,   520,    61,     3,    94,
+   113,   119,   106,    65,    64,   407,    58,   529,   118,    32,
+   273,   132,   613,   130,   216,   201,   219,   220,   221,   606,
     60,   205,   225,   315,   115,   175,   312,   479,   189,   206,
    186,   190,   192,    74,   198,   176,    72,    18,    11,     2,
-   136,    69,   570,   178,   185,    52,    33,   194,   197,   200,
-   218,   182,    63,   221,    64,   223,   224,   204,   226,   227,
-   174,   177,   179,   107,   208,   181,   184,   180,   173,   231,
-   188,   232,   233,   234,   235,   191,   193,   106,   196,   199,
+   136,   218,    69,   178,   185,   222,   223,   224,   570,   226,
+   227,   182,    63,   173,   231,    52,   232,   233,   234,   235,
+    33,   194,   197,   107,   208,    64,   200,   180,   204,   174,
+   177,   179,   181,   184,   188,   191,   193,   106,   196,   199,
     27,    45,   210,    22,   163,   138,    14,   406,     6,   214,
    580,   600,     4,   542,   592,   572,   nil,   nil,   nil,   nil,
    256,   nil,   nil,   nil,   nil,   nil,   257,   nil,   nil,   nil,
-   nil,   nil,   nil,   253,   nil,   nil,   nil,   nil,   nil,   318,
+   318,   nil,   nil,   253,   nil,   nil,   nil,   nil,   nil,   nil,
    nil,   nil,   nil,   nil,   nil,   304,   nil,   nil,   nil,   252,
    nil,   308,   nil,   nil,   nil,   nil,   251,   nil,   nil,   nil,
@@ -524,17 +469,17 @@
     18,   104,    80,    34,    23,    15,    22,   103,    81,    24,
     23,    15,    82,   114,    51,    87,    78,    48,    59,    62,
-    26,    72,    71,    66,    60,    69,    14,     1,    52,    23,
-    83,    86,    23,   108,    60,    57,    58,    50,    85,    39,
-    14,    69,    60,    37,   110,    80,   110,   110,    36,   110,
+    57,    72,    71,    60,   108,    14,    26,    69,     1,    23,
+    83,    86,    23,    60,    66,    52,    58,    50,    85,    14,
+    39,    60,    37,    69,   110,    80,   110,   110,   110,    36,
     68,    81,   110,    25,    84,    82,    20,    53,    87,    74,
     75,    76,    77,    17,    79,    71,    16,    13,    12,    11,
-    10,     9,    26,    83,    86,     8,     7,    89,    90,    91,
-   108,    85,    72,   108,    66,   108,   108,    92,   108,   108,
-    93,    94,    95,    59,    62,    96,    97,    84,    57,    57,
-    98,    57,    57,    57,    57,    99,   100,    23,   101,   102,
+    10,   108,     9,    83,    86,   108,   108,   108,    26,   108,
+   108,    85,    72,    57,    57,     8,    57,    57,    57,    57,
+     7,    89,    90,    59,    62,    66,    91,    84,    92,    93,
+    94,    95,    96,    97,    98,    99,   100,    23,   101,   102,
      6,    23,    15,     5,   105,   107,     4,    48,     3,   111,
    112,   113,     2,   115,   126,   128,   nil,   nil,   nil,   nil,
     80,   nil,   nil,   nil,   nil,   nil,    81,   nil,   nil,   nil,
-   nil,   nil,   nil,    87,   nil,   nil,   nil,   nil,   nil,   108,
+   108,   nil,   nil,    87,   nil,   nil,   nil,   nil,   nil,   nil,
    nil,   nil,   nil,   nil,   nil,    80,   nil,   nil,   nil,    86,
    nil,    81,   nil,   nil,   nil,   nil,    85,   nil,   nil,   nil,
@@ -580,15 +525,15 @@
 
 racc_goto_pointer = [
-   nil,    27,   122,   118,   110,    99,    88,    49,    42,    19,
-     1,    69,    63,    55,    14,   -23,    13,    10,   -53,   nil,
-  -159,   nil,   -80,   -24,  -206,  -162,  -457,   nil,   nil,   nil,
-   nil,   nil,   nil,   nil,   -85,   nil,  -550,  -563,   nil,  -173,
+   nil,    28,   122,   118,   110,    99,    88,    63,    52,    20,
+     1,    69,    63,    55,    13,   -23,    13,    10,   -53,   nil,
+  -159,   nil,   -80,   -24,  -206,  -162,  -451,   nil,   nil,   nil,
+   nil,   nil,   nil,   nil,   -85,   nil,  -549,  -564,   nil,  -172,
    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,  -198,   nil,
-  -440,  -386,  -288,  -350,   nil,   nil,   nil,   -66,    -4,   -38,
-   -24,   nil,   -37,   nil,   nil,   nil,   -22,   nil,     6,   -19,
+  -440,  -386,  -281,  -350,   nil,   nil,   nil,   -81,    -4,   -38,
+   -25,   nil,   -37,   nil,   nil,   nil,   -11,   nil,     6,   -17,
    nil,   -37,   -24,   nil,   -47,   -42,   -41,   -40,   -86,   -38,
-   -57,   -51,   -47,   -29,    -5,   -21,   -28,   -44,   nil,   -25,
-   -24,   -23,   -15,   -12,   -11,   -10,    -7,    -6,    -2,     3,
-     4,     6,     7,   -95,   -78,    23,   nil,    39,   -68,   nil,
+   -57,   -51,   -47,   -29,    -5,   -21,   -28,   -44,   nil,   -11,
+   -10,    -6,    -4,    -3,    -2,    -1,     0,     1,     2,     3,
+     4,     6,     7,   -95,   -78,    23,   nil,    39,   -77,   nil,
   -103,   -24,  -421,  -457,  -306,  -359,   nil,   nil,   nil,   nil,
    nil,   nil,   nil,   nil,   nil,   nil,  -443,   nil,  -409 ]
@@ -905,5 +850,5 @@
   3, 206, :_reduce_293,
   5, 147, :_reduce_294,
-  1, 207, :_reduce_none,
+  1, 207, :_reduce_295,
   3, 207, :_reduce_none,
   3, 207, :_reduce_none,
@@ -2516,5 +2461,5 @@
 # reduce 167 omitted
 
-module_eval(<<'.,.,', 'parser.y', 822)
+module_eval(<<'.,.,', 'parser.y', 820)
   def _reduce_168(val, _values, result)
         begin
@@ -2529,5 +2474,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 831)
+module_eval(<<'.,.,', 'parser.y', 829)
   def _reduce_169(val, _values, result)
         begin
@@ -2542,5 +2487,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 840)
+module_eval(<<'.,.,', 'parser.y', 838)
   def _reduce_170(val, _values, result)
         begin
@@ -2579,5 +2524,5 @@
 # reduce 182 omitted
 
-module_eval(<<'.,.,', 'parser.y', 865)
+module_eval(<<'.,.,', 'parser.y', 863)
   def _reduce_183(val, _values, result)
         result = true
@@ -2587,5 +2532,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 869)
+module_eval(<<'.,.,', 'parser.y', 867)
   def _reduce_184(val, _values, result)
         result = false
@@ -2609,5 +2554,5 @@
 # reduce 191 omitted
 
-module_eval(<<'.,.,', 'parser.y', 884)
+module_eval(<<'.,.,', 'parser.y', 882)
   def _reduce_192(val, _values, result)
         result = val[0]
@@ -2667,5 +2612,5 @@
 # reduce 217 omitted
 
-module_eval(<<'.,.,', 'parser.y', 919)
+module_eval(<<'.,.,', 'parser.y', 917)
   def _reduce_218(val, _values, result)
         @@logger.debug("V_ISO8601_EXTENDED_DATE_TIME: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2700,5 +2645,5 @@
 # reduce 230 omitted
 
-module_eval(<<'.,.,', 'parser.y', 939)
+module_eval(<<'.,.,', 'parser.y', 937)
   def _reduce_231(val, _values, result)
         @@logger.debug("V_ISO8601_DURATION: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2733,5 +2678,5 @@
 # reduce 243 omitted
 
-module_eval(<<'.,.,', 'parser.y', 959)
+module_eval(<<'.,.,', 'parser.y', 957)
   def _reduce_244(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: V_QUALIFIED_TERM_CODE_REF = #{val[0]} at #{@filename}:#{@lineno}")
@@ -2748,5 +2693,5 @@
 # reduce 247 omitted
 
-module_eval(<<'.,.,', 'parser.y', 969)
+module_eval(<<'.,.,', 'parser.y', 967)
   def _reduce_248(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: V_URI = #{val[0]} at #{@filename}:#{@lineno}")
@@ -2773,5 +2718,5 @@
 # reduce 256 omitted
 
-module_eval(<<'.,.,', 'parser.y', 992)
+module_eval(<<'.,.,', 'parser.y', 990)
   def _reduce_257(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}, boolean_node:  relative_path = #{val[0]}, regexp_body => #{val[3]} at #{@filename}") 
@@ -2838,5 +2783,5 @@
 # reduce 285 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1039)
+module_eval(<<'.,.,', 'parser.y', 1037)
   def _reduce_286(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}, relative_path = #{val[0]}") 
@@ -2847,5 +2792,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1044)
+module_eval(<<'.,.,', 'parser.y', 1042)
   def _reduce_287(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}, relative_path = #{val[0]}/#{val[2]}") 
@@ -2856,5 +2801,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1050)
+module_eval(<<'.,.,', 'parser.y', 1048)
   def _reduce_288(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}") 
@@ -2865,5 +2810,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1055)
+module_eval(<<'.,.,', 'parser.y', 1053)
   def _reduce_289(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}") 
@@ -2874,5 +2819,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1067)
+module_eval(<<'.,.,', 'parser.y', 1065)
   def _reduce_290(val, _values, result)
         result = Range.new(1,1)
@@ -2882,5 +2827,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1071)
+module_eval(<<'.,.,', 'parser.y', 1069)
   def _reduce_291(val, _values, result)
         result = val[3]
@@ -2890,5 +2835,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1076)
+module_eval(<<'.,.,', 'parser.y', 1074)
   def _reduce_292(val, _values, result)
         begin
@@ -2903,5 +2848,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1085)
+module_eval(<<'.,.,', 'parser.y', 1083)
   def _reduce_293(val, _values, result)
         begin
@@ -2917,5 +2862,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1096)
+module_eval(<<'.,.,', 'parser.y', 1094)
   def _reduce_294(val, _values, result)
         result = OpenEhr::AM::Archetype::ConstraintModel::CARDINALITY.new
@@ -2925,5 +2870,11 @@
 .,.,
 
-# reduce 295 omitted
+module_eval(<<'.,.,', 'parser.y', 1099)
+  def _reduce_295(val, _values, result)
+        result = val[0]
+  
+    result
+  end
+.,.,
 
 # reduce 296 omitted
@@ -2941,5 +2892,5 @@
 # reduce 302 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1110)
+module_eval(<<'.,.,', 'parser.y', 1111)
   def _reduce_303(val, _values, result)
         result = val[0]
@@ -2949,5 +2900,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1114)
+module_eval(<<'.,.,', 'parser.y', 1115)
   def _reduce_304(val, _values, result)
         result = val[0]
@@ -2959,5 +2910,5 @@
 # reduce 305 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1121)
+module_eval(<<'.,.,', 'parser.y', 1122)
   def _reduce_306(val, _values, result)
         case val[3]
@@ -2974,5 +2925,5 @@
 # reduce 307 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1132)
+module_eval(<<'.,.,', 'parser.y', 1133)
   def _reduce_308(val, _values, result)
         result = val[0]
@@ -2982,5 +2933,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1136)
+module_eval(<<'.,.,', 'parser.y', 1137)
   def _reduce_309(val, _values, result)
         result = OpenEhr::RM::Support::AssumedTypes::Interval.new(val[0], val[2])
@@ -3076,5 +3027,5 @@
 # reduce 352 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1202)
+module_eval(<<'.,.,', 'parser.y', 1203)
   def _reduce_353(val, _values, result)
         result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN.new(:true_valid => true)
@@ -3084,5 +3035,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1206)
+module_eval(<<'.,.,', 'parser.y', 1207)
   def _reduce_354(val, _values, result)
         result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN.new(:true_valid => false)
@@ -3092,5 +3043,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1210)
+module_eval(<<'.,.,', 'parser.y', 1211)
   def _reduce_355(val, _values, result)
         result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN.new(:true_valid => true,:false_valid => false)
@@ -3100,5 +3051,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1214)
+module_eval(<<'.,.,', 'parser.y', 1215)
   def _reduce_356(val, _values, result)
         result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN.new(:true_valid => false,:false_valid => true)
@@ -3108,5 +3059,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1219)
+module_eval(<<'.,.,', 'parser.y', 1220)
   def _reduce_357(val, _values, result)
         result = val[0]
@@ -3116,5 +3067,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1223)
+module_eval(<<'.,.,', 'parser.y', 1224)
   def _reduce_358(val, _values, result)
         result = val[0]
@@ -3125,5 +3076,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1228)
+module_eval(<<'.,.,', 'parser.y', 1229)
   def _reduce_359(val, _values, result)
         raise 'Not implemented yet'
@@ -3143,5 +3094,5 @@
 # reduce 364 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1240)
+module_eval(<<'.,.,', 'parser.y', 1241)
   def _reduce_365(val, _values, result)
         @in_interval = false
@@ -3152,5 +3103,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1247)
+module_eval(<<'.,.,', 'parser.y', 1248)
   def _reduce_366(val, _values, result)
           result = val[0]
@@ -3160,5 +3111,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1251)
+module_eval(<<'.,.,', 'parser.y', 1252)
   def _reduce_367(val, _values, result)
           result = val[0]
@@ -3168,5 +3119,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1257)
+module_eval(<<'.,.,', 'parser.y', 1258)
   def _reduce_368(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}, START_TERM_CODE_CONSTRAINT = #{val[0]} at #{@filename}")
@@ -3185,5 +3136,5 @@
 # reduce 371 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1273)
+module_eval(<<'.,.,', 'parser.y', 1274)
   def _reduce_372(val, _values, result)
           result = val[0]
@@ -3193,5 +3144,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1278)
+module_eval(<<'.,.,', 'parser.y', 1279)
   def _reduce_373(val, _values, result)
           result = val[0]
@@ -3201,5 +3152,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1282)
+module_eval(<<'.,.,', 'parser.y', 1283)
   def _reduce_374(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}")
@@ -3210,5 +3161,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1293)
+module_eval(<<'.,.,', 'parser.y', 1294)
   def _reduce_375(val, _values, result)
         result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_DURATION.new #val[0]
Index: ruby/trunk/lib/adl_parser/lib/parser.y
===================================================================
--- ruby/trunk/lib/adl_parser/lib/parser.y	(revision 322)
+++ ruby/trunk/lib/adl_parser/lib/parser.y	(revision 323)
@@ -802,6 +802,4 @@
     result = - integer
   }
-###   | '+' V_INTEGER
-###   | '-' V_INTEGER
 
 integer_list_value: integer_value Comma_code integer_value
@@ -1012,5 +1010,5 @@
   | SYM_FALSE
 
-arithmetic_node: arithmetic_expression '+' arithmetic_leaf
+arithmetic_node: arithmetic_expression Plus_code arithmetic_leaf
   | arithmetic_expression Minus_code arithmetic_leaf
   | arithmetic_expression Star_code arithmetic_leaf
@@ -1099,4 +1097,7 @@
 
 cardinality_spec: occurrence_spec
+  {
+    result = val[0]
+  }
   | occurrence_spec Semicolon_code SYM_ORDERED
   | occurrence_spec Semicolon_code SYM_UNORDERED
@@ -1330,59 +1331,4 @@
 end
 
-
-###----------/* keywords */ --------------------------------------------- 
-### @@adl_reserved = {
-###     'archetype' => :SYM_ARCHETYPE,
-###     'adl_version' => :SYM_ADL_VERSION,
-###     'controlled' => :SYM_IS_CONTROLLED,
-###     'specialize' => :SYM_SPECIALIZE,
-###     'concept' => :SYM_CONCEPT,
-###     'language' => :SYM_LANGUAGE,
-###     'description' => :SYM_DESCRIPTION,
-###     'definition' => :SYM_DEFINITION,
-###     'invariant' => :SYM_INVARIANT,
-###     'ontology' => :SYM_ONTOLOGY,
-###     'matches' => :SYM_MATCHES,
-###     'is_in' => :SYM_MATCHES,
-###     'occurrences' => :SYM_OCCURRENCES,
-###     'true' => :SYM_TRUE, #[Tt][Rr][Uu][Ee] -- -> SYM_TRUE 
-###     'false' => :SYM_FALSE, # [Ff][Aa][Ll][Ss][Ee] -- -> SYM_FALSE 
-###     'infinity' => :SYM_INFINITY # [Ii][Nn][Ff][Ii][Nn][Ii][Tt][Yy] -- -> SYM_INFINITY 
-### }
-
-### @@dadl_reserved = {
-###   'true' => :SYM_TRUE, #[Tt][Rr][Uu][Ee] -- -> SYM_TRUE 
-###   'false' => :SYM_FALSE, # [Ff][Aa][Ll][Ss][Ee] -- -> SYM_FALSE 
-###   'infinity' => :SYM_INFINITY # [Ii][Nn][Ff][Ii][Nn][Ii][Tt][Yy] -- -> SYM_INFINITY 
-### }
-
-### @@cadl_reserved = {
-###   'then' => :SYM_THEN, # [Tt][Hh][Ee][Nn]
-###   'else' => :SYM_ELSE, # [Ee][Ll][Ss][Ee]
-###   'and' => :SYM_AND, # [Aa][Nn][Dd]
-###   'or' => :SYM_OR, # [Oo][Rr]
-###   'xor' => :SYM_XOR, # [Xx][Oo][Rr]
-###   'not' => :SYM_NOT, # [Nn][Oo][Tt]
-###   'implies' => :SYM_IMPLIES, # [Ii][Mm][Pp][Ll][Ii][Ee][Ss]
-###   'true' => :SYM_TRUE, #[Tt][Rr][Uu][Ee] -- -> SYM_TRUE 
-###   'false' => :SYM_FALSE, # [Ff][Aa][Ll][Ss][Ee] -- -> SYM_FALSE 
-###   'forall' => :SYM_FORALL, # [Ff][Oo][Rr][_][Aa][Ll][Ll]
-###   'exists' => :SYM_EXISTS, # [Ee][Xx][Ii][Ss][Tt][Ss]
-###   'existence' => :SYM_EXISTENCE, # [Ee][Xx][Iu][Ss][Tt][Ee][Nn][Cc][Ee]
-###   'occurrences' => :SYM_OCCURRENCES, # [Oo][Cc][Cc][Uu][Rr][Rr][Ee][Nn][Cc][Ee][Ss]
-###   'cardinality' => :SYM_CARDINALITY, # [Cc][Aa][Rr][Dd][Ii][Nn][Aa][Ll][Ii][Tt][Yy]
-###   'ordered' => :SYM_ORDERED, # [Oo][Rr][Dd][Ee][Rr][Ee][Dd]
-###   'unordered' => :SYM_UNORDERED, # [Uu][Nn][Oo][Rr][Dd][Ee][Rr][Ee][Dd]
-###   'unique' => :SYM_UNIQUE, # [Uu][Nn][Ii][Qq][Uu][Ee]
-###   'matches' => :SYM_MATCHES, # [Mm][Aa][Tt][Cc][Hh][Ee][Ss]
-###   'is_in' => :SYM_MATCHES, # [Ii][Ss][_][Ii][Nn]
-###   'invariant' => :SYM_INVARIANT, # [Ii][Nn][Vv][Aa][Rr][Ii][Aa][Nn][Tt]
-###   'infinity' => :SYM_INFINITY, # [Ii][Nn][Ff][Ii][Nn][Ii][Tt][Yy] -- -> SYM_INFINITY 
-###   'use_node' => :SYM_USE_NODE, # [Uu][Ss][Ee][_][Nn][Oo][Dd][Ee]
-###   'use_archetype' => :SYM_ALLOW_ARCHETYPE, # [Uu][Ss][Ee][_][Aa][Rr][Cc][Hh][Ee][Tt][Yy][Pp][Ee]
-###   'allow_archetype' => :SYM_ALLOW_ARCHETYPE, # [Aa][Ll][Ll][Oo][Ww][_][Aa][Rr][Cc][Hh][Ee][Tt][Yy][Pp][Ee]
-###   'include' => :SYM_INCLUDE, # [Ii][Nn][Cc][Ll][Uu][Dd][Ee]
-###   'exclude' => :SYM_EXCLUDE # [Ee][Xx][Cc][Ll][Uu][Dd][Ee]
-### }
 
 
Index: ruby/trunk/lib/adl_parser/test/adl/adl-test-ENTRY.basic_types_fail.v1.adl
===================================================================
--- ruby/trunk/lib/adl_parser/test/adl/adl-test-ENTRY.basic_types_fail.v1.adl	(revision 323)
+++ ruby/trunk/lib/adl_parser/test/adl/adl-test-ENTRY.basic_types_fail.v1.adl	(revision 323)
@@ -0,0 +1,50 @@
+archetype
+	adl-test-ENTRY.basic_types_fail.v1
+
+concept
+	[at0000]	-- test entry
+
+description
+	original_author = <
+		["name"] = <"Thomas Beale">
+	>
+	lifecycle_state = <"draft">
+	details = <
+		["en"] = <
+			language = <"en">
+			purpose = <"test structure">
+			keywords = <"ADL", "test">
+			copyright = <"copyright (c) 2004 The openEHR Foundation">
+		>
+	>
+
+definition
+	ENTRY[at0000] matches {	-- test entry
+		-- string_attr3 matches {/cardio.*//}
+		string_attr5 matches {"and", "something", "else" "ERROR"}
+		boolean_attr3 matches {True, False, False}
+		integer_attr1 matches {55 !}
+		integer_attr2 matches {10 20, 30}
+		integer_attr4 matches {> 10|}
+		date_attr1 matches {pyyyy-mm-dd}
+		date_attr2 matches {yyyy-Q?--??}
+		date_attr5 matches {1983-0012-25}
+		date_attr6 matches {2000-0101}
+		time_attr2 matches {Ph:Tm:XX}
+		time_attr3 matches {hh:??XX}
+	}
+
+ontology
+	primary_language = <"en">
+	languages_available = <"en", ...>
+	terminologies_available = <"adl_test", ...>
+	term_definitions = <
+		["en"] = <
+			items = <
+				["at0000"] = <
+					description = <"test entry">
+					text = <"test entry">
+				>
+			>
+		>
+	>
Index: ruby/trunk/lib/adl_parser/test/adl/adl-test-ENTRY.most_minimal.v1.adl
===================================================================
--- ruby/trunk/lib/adl_parser/test/adl/adl-test-ENTRY.most_minimal.v1.adl	(revision 323)
+++ ruby/trunk/lib/adl_parser/test/adl/adl-test-ENTRY.most_minimal.v1.adl	(revision 323)
@@ -0,0 +1,27 @@
+archetype (adl_version=1.4)
+	adl-test-ENTRY.most_minimal.v1
+
+concept
+	[at0000]	-- most minimal
+language
+	original_language = <[ISO_639-1::en]>
+description
+	original_author = <
+		["name"] = <"unknown">
+	>
+	lifecycle_state = <>
+
+definition
+	ENTRY[at0000] matches {*}
+
+ontology
+	term_definitions = <
+		["en"] = <
+			items = <
+				["at0000"] = <
+					description = <"most minimal">
+					text = <"most minimal">
+				>
+			>
+		>
+	>
Index: ruby/trunk/lib/adl_parser/test/adl/adl-test-ENTRY.structure_test1.v1.adl
===================================================================
--- ruby/trunk/lib/adl_parser/test/adl/adl-test-ENTRY.structure_test1.v1.adl	(revision 323)
+++ ruby/trunk/lib/adl_parser/test/adl/adl-test-ENTRY.structure_test1.v1.adl	(revision 323)
@@ -0,0 +1,46 @@
+archetype (adl_version=1.4)
+	adl-test-ENTRY.structure_test1.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 basic structure hierarchy">
+			keywords = <"ADL", "structure", "test">
+			copyright = <"copyright (c) 2004 The openEHR Foundation">
+		>
+	>
+	lifecycle_state = <"draft">
+
+definition
+	ENTRY[at0000] matches {	-- test entry
+		subject_relationship matches {
+			RELATED_PARTY matches {
+				relationship matches {
+					TEXT matches {
+						value matches {"self"}
+					}
+				}
+			}
+		}
+	}
+
+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 322)
+++ ruby/trunk/lib/adl_parser/test/parser_test.rb	(revision 323)
@@ -258,4 +258,12 @@
   end
 
+  must "adl-test-ENTRY.assumed_types.v1.adl be properly parsed" do
+    file =  File.read("#{TEST_ROOT_DIR}/adl/adl-test-ENTRY.assumed_types.v1.adl")
+    assert_nothing_raised do
+      ast = @parser.parse(file, 'adl-test-ENTRY.assumed_types.v1')
+      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+    end
+  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")
@@ -267,8 +275,24 @@
 
 
-  must "adl-test-ENTRY.assumed_types.v1.adl be properly parsed" do
-    file =  File.read("#{TEST_ROOT_DIR}/adl/adl-test-ENTRY.assumed_types.v1.adl")
-    assert_nothing_raised do
-      ast = @parser.parse(file, 'adl-test-ENTRY.assumed_types.v1')
+  must "adl-test-ENTRY.basic_types_fail.v1.adl be properly parsed" do
+    file =  File.read("#{TEST_ROOT_DIR}/adl/adl-test-ENTRY.basic_types_fail.v1.adl")
+    assert_raise Racc::ParseError do
+      ast = @parser.parse(file, 'adl-test-ENTRY.basic_types_fail.v1')
+      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+    end
+  end
+
+  must "adl-test-ENTRY.most_minimal.v1.adl be properly parsed" do
+    file =  File.read("#{TEST_ROOT_DIR}/adl/adl-test-ENTRY.most_minimal.v1.adl")
+    assert_nothing_raised do
+      ast = @parser.parse(file, 'adl-test-ENTRY.most_minimal.v1')
+      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
+    end
+  end
+
+  must "adl-test-ENTRY.structure_test1.v1.adl be properly parsed" do
+    file =  File.read("#{TEST_ROOT_DIR}/adl/adl-test-ENTRY.structure_test1.v1.adl")
+    assert_nothing_raised do
+      ast = @parser.parse(file, 'adl-test-ENTRY.structure_test1.v1')
       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
     end
Index: ruby/trunk/lib/adl_parser/test/remote_adl_test.rb
===================================================================
--- ruby/trunk/lib/adl_parser/test/remote_adl_test.rb	(revision 322)
+++ ruby/trunk/lib/adl_parser/test/remote_adl_test.rb	(revision 323)
@@ -28,10 +28,31 @@
 
 
-  must "test_adls should properly parsed" do
+#   must "test_adls should properly parsed" do
+#     assert_nothing_raised do
+#       @test_adls.each do |adl|
+#         puts "Processing #{adl}"
+#         open(adl) do |file|
+#           p "Processing #{file.gets}"
+#           case file.gets
+#           when "http://www.openehr.org/svn/knowledge/archetypes/dev/adl/test/basics/adl-test-ENTRY.basic_types_fail.v1.adl"
+#             assert_raise Racc::ParserError do 
+#               @parser.parse(file.read, adl)
+#             end
+#           else
+#             assert_nothing_raised { @parser.parse(file.read, adl) }
+#           end
+#         end
+#       end
+#     end
+#   end
+
+  must "ehr_adls should properly parsed" do
     assert_nothing_raised do
-      @test_adls.each do |adl|
+      @ehr_adls.each do |adl|
         puts "Processing #{adl}"
         open(adl) do |file|
-          @parser.parse(file.read, adl)
+          assert_nothing_raised do
+            @parser.parse(file.read, adl)
+          end
         end
       end
@@ -39,15 +60,4 @@
   end
 
-#   must "ehr_adls should properly parsed" do
-#     assert_nothing_raised do
-#       @ehr_adls.each do |adl|
-#         puts "Processing #{adl}"
-#         open(adl) do |file|
-#           @parser.parse(file.read, adl)
-#         end
-#       end
-#     end
-#   end
-
 
 end
