Changeset 323


Ignore:
Timestamp:
Oct 19, 2009, 5:10:43 PM (15 years ago)
Author:
Tatsukawa, Akimichi
Message:

commit at the timing of leaving Pittsburgh

Location:
ruby
Files:
3 added
8 edited

Legend:

Unmodified
Added
Removed
  • ruby/branches/TRY-open_ehr_gem/lib/open_ehr.rb

    r318 r323  
    4747        autoload :CARDINALITY, "am/archetype/constraint_model/archetype_constraint.rb"
    4848        autoload :C_SINGLE_ATTRIBUTE, "am/archetype/constraint_model/archetype_constraint.rb"
     49        autoload :C_COMPLEX_OBJECT, "am/archetype/constraint_model/archetype_constraint.rb"
    4950        autoload :ARCHETYPE_SLOT, "am/archetype/constraint_model/archetype_constraint.rb"
    5051        autoload :Primitive, "am/archetype/constraint_model/primitive.rb"
  • ruby/trunk/lib/adl_parser/lib/adl_exception.rb

    r307 r323  
    55      end
    66
    7       module CADLScanner
     7      module Scanner
    88        class Base < RuntimeError
    99        end
    1010      end
     11
     12      module Parser
     13        class Base < RuntimeError
     14        end
     15      end
     16
     17
     18      #
     19      #
     20      # c.f. beale07:_archet_defin_languag,p.100
     21      module Validation
     22        class Base < RuntimeError
     23        end
     24
     25        class VARID < Base
     26          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."
     27        end
     28
     29        class VARCN < Base
     30          MESSAGE = "The archetype must have an archetype term value in concept section. The term must exist in the archetype ontology."
     31        end
     32
     33        class VARDF < Base
     34          MESSAGE = "The archetype must have a definition section, expressed as a cADL syntax."
     35        end
     36
     37        class VARON < Base
     38          MESSAGE = "The archetype must have a ontology section, expressed as a dADL syntax."
     39        end
     40
     41        class VARDT < Base
     42          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."
     43        end
     44
     45        class VATDF < Base
     46          MESSAGE = "Each archetype term used as a node identifier the archetype definition must be defined in the term_definitions part of the ontology."
     47        end
     48
     49        class VACDF < Base
     50          MESSAGE = "Each constraint code used in the archetype definition must be defined in the constraint_definition part of the ontology."
     51        end
     52
     53        class VDFAI < Base
     54          MESSAGE = "Any archetype identifier mentioned in an archetype slot in the definition section must conform to the published openEHR specification for archetype identifiers."
     55        end
     56
     57        class VDFPT < Base
     58          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."
     59        end
     60      end
     61
    1162    end
    1263  end
  • ruby/trunk/lib/adl_parser/lib/adl_scanner.rb

    r321 r323  
    8989              when /\A(\w+)-(\w+)-(\w+)\.(\w+)((?:-\w+)*)\.(v\w+)/   #V_ARCHETYPE_ID
    9090                object_id, rm_originator, rm_name, rm_entity, concept_name, specialisation, version_id = $&, $1, $2, $3, $4, $5, $6
    91                 #archetype_id = OpenEhr::RM::Support::Identification::ArchetypeID.new(object_id, concept_name, rm_name, rm_entity, rm_originator, specialisation, version_id)
    92                 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)
     91                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)
    9392                yield :V_ARCHETYPE_ID, archetype_id
    9493              when /\A[a-z][a-zA-Z0-9_]*/
     
    848847
    849848
    850 #       module Common
    851 #         class START_TERM_CODE_CONSTRAINT
    852 #           include Yaparc::Parsable
    853 #           def initialize
    854 #             @parser = lambda do |input|
    855 #               Yaparc::Apply.new(Yaparc::Regex.new(/[ \t\n]*\[([a-zA-Z0-9\(\)\._\-]+)::[ \t\n]*/)) do |match|
    856 #                 OpenEhr::LOG.info("START_TERM_CODE_CONSTRAINT: #{match}")
    857 #                 [:START_TERM_CODE_CONSTRAINT, match]
    858 #               end
    859 #             end
    860 #           end
    861 #         end
    862 
    863 #         # /\A\[[a-zA-Z0-9()\._-]+::[a-zA-Z0-9\._-]+\]/  #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]
    864 #         class V_QUALIFIED_TERM_CODE_REF
    865 #           include Yaparc::Parsable
    866 #           def initialize
    867 #             @parser = lambda do |input|
    868 #               Yaparc::Apply.new(Yaparc::Regex.new(/\A\[[a-zA-Z0-9()\._-]+::[a-zA-Z0-9\._-]+\]/)) do |match|
    869 #                 OpenEhr::LOG.info("V_QUALIFIED_TERM_CODE_REF: #{match}")
    870 #                 [:V_QUALIFIED_TERM_CODE_REF, match]
    871 #               end
    872 #             end
    873 #           end
    874 #         end
    875        
    876 #         class V_LOCAL_TERM_CODE_REF
    877 #           include Yaparc::Parsable
    878 #           def initialize
    879 #             @parser = lambda do |input|
    880 #               Yaparc::Apply.new(Yaparc::Regex.new(/\A\[[a-zA-Z0-9][a-zA-Z0-9._\-]*\]/)) do |match|
    881 #                 OpenEhr::LOG.info("V_TERM_CODE_REF: #{match}")
    882 #                 [:V_LOCAL_TERM_CODE_REF, match]
    883 #               end
    884 #             end
    885 #           end
    886 #         end
    887 
    888 #         class ERR_V_QUALIFIED_TERM_CODE_REF
    889 #           include Yaparc::Parsable
    890 #           def initialize
    891 #             @parser = lambda do |input|
    892 #               Yaparc::Apply.new(Yaparc::Regex.new(/\A\[[a-zA-Z0-9._\- ]+::[a-zA-Z0-9._\- ]+\]/)) do |match|
    893 #                 OpenEhr::LOG.info("ERR_V_QUALIFIED_TERM_CODE_REF: #{match}")
    894 #                 [:ERR_V_QUALIFIED_TERM_CODE_REF, match]
    895 #               end
    896 #             end
    897 #           end
    898 #         end
    899 
    900 #         class V_TYPE_IDENTIFIER
    901 #           include Yaparc::Parsable
    902 #           def initialize
    903 #             @parser = lambda do |input|
    904 #               Yaparc::Apply.new(Yaparc::Regex.new(/\A[A-Z][a-zA-Z0-9_]*/)) do |match|
    905 #                 OpenEhr::LOG.info("V_TYPE_IDENTIFIER: #{match}")
    906 #                 [:V_TYPE_IDENTIFIER, match]
    907 #               end
    908 #             end
    909 #           end
    910 #         end
    911 
    912 #         class V_GENERIC_TYPE_IDENTIFIER
    913 #           include Yaparc::Parsable
    914 #           def initialize
    915 #             @parser = lambda do |input|
    916 #               Yaparc::Apply.new(Yaparc::Regex.new(/\A[A-Z][a-zA-Z0-9_]*<[a-zA-Z0-9,_<>]+>/)) do |match|
    917 #                 OpenEhr::LOG.info("V_GENERIC_TYPE_IDENTIFIER: #{match}")
    918 #                 [:V_GENERIC_TYPE_IDENTIFIER, match]
    919 #               end
    920 #             end
    921 #           end
    922 #         end
    923 
    924 
    925 #         class V_LOCAL_CODE
    926 #           include Yaparc::Parsable
    927 #           def initialize
    928 #             @parser = lambda do |input|
    929 #               Yaparc::Apply.new(Yaparc::Regex.new(/\Aa[ct][0-9.]+/)) do |match|
    930 #                 OpenEhr::LOG.info("V_LOCAL_CODE: #{match}")
    931 #                 [:V_LOCAL_CODE, match]
    932 #               end
    933 #             end
    934 #           end
    935 #         end
    936 
    937 #         class V_STRING
    938 #           include Yaparc::Parsable
    939 #           def initialize
    940 #             @parser = lambda do |input|
    941 #               Yaparc::Apply.new(Yaparc::Regex.new(/\A"([^"]*)"/m)) do |match|
    942 #                 OpenEhr::LOG.info("V_STRING: #{match}")
    943 #                 [:V_STRING, match]
    944 #               end
    945 #             end
    946 #           end
    947 #         end
    948 
    949 #         class V_REAL
    950 #           include Yaparc::Parsable
    951 #           def initialize
    952 #             @parser = lambda do |input|
    953 #               Yaparc::Apply.new(Yaparc::Regex.new(/\A[0-9]+\.[0-9]+|[0-9]+\.[0-9]+[eE][+-]?[0-9]+/)) do |match|
    954 #                 OpenEhr::LOG.info("V_REAL: #{match}")
    955 #                 [:V_REAL, match]
    956 #               end
    957 #             end
    958 #           end
    959 #         end
    960 
    961 #         #V_ISO8601_DURATION PnYnMnWnDTnnHnnMnnS
    962 #         class V_ISO8601_DURATION
    963 #           include Yaparc::Parsable
    964 #           def initialize
    965 #             @parser = lambda do |input|
    966 #               Yaparc::Apply.new(
    967 #                                 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])?/),
    968 #                                                 Yaparc::Regex.new(/\AP([0-9]+|[yY])?([0-9]+|[mM])?([0-9]+|[wW])?([0-9]+|[dD])?/))) do |match|
    969 #                 OpenEhr::LOG.info("V_ISO8601_DURATION: #{match}")
    970 #                 [:V_ISO8601_DURATION, match]
    971 #               end
    972 #             end
    973 #           end
    974 #         end
    975 
    976 #       end # of Common
    977 
    978 #       module DADL
    979 #         # c.f. http://www.openehr.org/svn/ref_impl_eiffel/TRUNK/components/adl_parser/src/syntax/adl/parser/adl_scanner.l
    980 #         RESERVED = {
    981 #           'true' => :SYM_TRUE, #[Tt][Rr][Uu][Ee] -- -> SYM_TRUE
    982 #           'false' => :SYM_FALSE, # [Ff][Aa][Ll][Ss][Ee] -- -> SYM_FALSE
    983 #           'infinity' => :SYM_INFINITY # [Ii][Nn][Ff][Ii][Nn][Ii][Tt][Yy] -- -> SYM_INFINITY
    984 #         }
    985 #         #
    986 #         # DADL::RootScanner
    987 #         #
    988 #         class RootScanner
    989 #           include Yaparc::Parsable
    990 #           def initialize
    991 #             @parser = lambda do |input|
    992 #               Yaparc::Alt.new(Reserved.new,
    993 #                               OpenEhr::ADL::Scanner::Common::V_QUALIFIED_TERM_CODE_REF.new,
    994 #                               OpenEhr::ADL::Scanner::Common::V_LOCAL_TERM_CODE_REF.new,
    995 #                               OpenEhr::ADL::Scanner::Common::ERR_V_QUALIFIED_TERM_CODE_REF.new,
    996 #                               OpenEhr::ADL::Scanner::Common::V_TYPE_IDENTIFIER.new,
    997 #                               OpenEhr::ADL::Scanner::Common::V_GENERIC_TYPE_IDENTIFIER.new,
    998 #                               OpenEhr::ADL::Scanner::Common::V_STRING.new,
    999 #                               OpenEhr::ADL::Scanner::Common::V_LOCAL_CODE.new,
    1000 #                               OpenEhr::ADL::Scanner::Common::V_REAL.new,
    1001 #                               OpenEhr::ADL::Scanner::Common::V_ISO8601_DURATION.new#,
    1002 #                               #OpenEhr::ADL::Scanner::Common::START_TERM_CODE_CONSTRAINT.new
    1003 #                               )
    1004 #             end
    1005 #           end
    1006 #         end
    1007 
    1008 #         #  <DADL::Reserved class>
    1009 #         class Reserved
    1010 #           include Yaparc::Parsable
    1011          
    1012 #           def initialize
    1013 #             @parser = lambda do |input|
    1014 #               reserved_parsers = OpenEhr::ADL::Scanner::DADL::RESERVED.map do |keyword|
    1015 #                 Yaparc::Tokenize.new(
    1016 #                                      Yaparc::Literal.new(keyword[0],false)
    1017 #                                      )
    1018 #               end
    1019 #               Yaparc::Alt.new(Yaparc::Apply.new(Yaparc::Alt.new(*reserved_parsers)) do |match|
    1020 #                                 OpenEhr::LOG.info("Reserved: #{match}")
    1021 #                                 [OpenEhr::ADL::Scanner::DADL::RESERVED[match], OpenEhr::ADL::Scanner::DADL::RESERVED[match]]
    1022 #                               end,
    1023 #                               Yaparc::Apply.new(Yaparc::Regex.new(/\A[a-z][a-zA-Z0-9_]*/)) do |match|
    1024 #                                 OpenEhr::LOG.info("V_ATTRIBUTE_IDENTIFIER: #{match}")
    1025 #                                 [:V_ATTRIBUTE_IDENTIFIER, match]
    1026 #                               end)
    1027 #             end
    1028 #           end
    1029 #         end
    1030 #       end # of DADL
    1031 
    1032 #       module CADL
    1033 #         # c.f. http://www.openehr.org/svn/ref_impl_eiffel/TRUNK/components/adl_parser/src/syntax/cadl/parser/cadl_scanner.l
    1034 #         RESERVED = {
    1035 #           'ordered' => :SYM_ORDERED, # [Oo][Rr][Dd][Ee][Rr][Ee][Dd]
    1036 #           'unordered' => :SYM_UNORDERED, # [Uu][Nn][Oo][Rr][Dd][Ee][Rr][Ee][Dd]
    1037 #           'then' => :SYM_THEN, # [Tt][Hh][Ee][Nn]
    1038 #           'else' => :SYM_ELSE, # [Ee][Ll][Ss][Ee]
    1039 #           'and' => :SYM_AND, # [Aa][Nn][Dd]
    1040 #           'or' => :SYM_OR, # [Oo][Rr]
    1041 #           'xor' => :SYM_XOR, # [Xx][Oo][Rr]
    1042 #           'not' => :SYM_NOT, # [Nn][Oo][Tt]
    1043 #           'implies' => :SYM_IMPLIES, # [Ii][Mm][Pp][Ll][Ii][Ee][Ss]
    1044 #           'true' => :SYM_TRUE, #[Tt][Rr][Uu][Ee] -- -> SYM_TRUE
    1045 #           'false' => :SYM_FALSE, # [Ff][Aa][Ll][Ss][Ee] -- -> SYM_FALSE
    1046 #           'forall' => :SYM_FORALL, # [Ff][Oo][Rr][_][Aa][Ll][Ll]
    1047 #           'exists' => :SYM_EXISTS, # [Ee][Xx][Ii][Ss][Tt][Ss]
    1048 #           'existence' => :SYM_EXISTENCE, # [Ee][Xx][Iu][Ss][Tt][Ee][Nn][Cc][Ee]
    1049 #           'occurrences' => :SYM_OCCURRENCES, # [Oo][Cc][Cc][Uu][Rr][Rr][Ee][Nn][Cc][Ee][Ss]
    1050 #           'cardinality' => :SYM_CARDINALITY, # [Cc][Aa][Rr][Dd][Ii][Nn][Aa][Ll][Ii][Tt][Yy]
    1051 #           'unique' => :SYM_UNIQUE, # [Uu][Nn][Ii][Qq][Uu][Ee]
    1052 #           'matches' => :SYM_MATCHES, # [Mm][Aa][Tt][Cc][Hh][Ee][Ss]
    1053 #           'is_in' => :SYM_MATCHES, # [Ii][Ss][_][Ii][Nn]
    1054 #           'invariant' => :SYM_INVARIANT, # [Ii][Nn][Vv][Aa][Rr][Ii][Aa][Nn][Tt]
    1055 #           'infinity' => :SYM_INFINITY, # [Ii][Nn][Ff][Ii][Nn][Ii][Tt][Yy] -- -> SYM_INFINITY
    1056 #           'use_node' => :SYM_USE_NODE, # [Uu][Ss][Ee][_][Nn][Oo][Dd][Ee]
    1057 #           'use_archetype' => :SYM_ALLOW_ARCHETYPE, # [Uu][Ss][Ee][_][Aa][Rr][Cc][Hh][Ee][Tt][Yy][Pp][Ee]
    1058 #           'allow_archetype' => :SYM_ALLOW_ARCHETYPE, # [Aa][Ll][Ll][Oo][Ww][_][Aa][Rr][Cc][Hh][Ee][Tt][Yy][Pp][Ee]
    1059 #           'include' => :SYM_INCLUDE, # [Ii][Nn][Cc][Ll][Uu][Dd][Ee]
    1060 #           'exclude' => :SYM_EXCLUDE # [Ee][Xx][Cc][Ll][Uu][Dd][Ee]
    1061 #         }
    1062 
    1063 #         #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]/
    1064 #         class V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN
    1065 #           include Yaparc::Parsable
    1066 #           def initialize
    1067 #             @parser = lambda do |input|
    1068 #               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|
    1069 #                 OpenEhr::LOG.info("V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN: #{match}")
    1070 #                 [:V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN, match]
    1071 #               end
    1072 #             end
    1073 #           end
    1074 #         end
    1075 
    1076 #         #V_ISO8601_DATE_CONSTRAINT_PATTERN  /\A[yY][yY][yY][yY]-[mM?X][mM?X]-[dD?X][dD?X]/
    1077 #         class V_ISO8601_DATE_CONSTRAINT_PATTERN
    1078 #           include Yaparc::Parsable
    1079 #           def initialize
    1080 #             @parser = lambda do |input|
    1081 #               Yaparc::Apply.new(Yaparc::Regex.new(/\A[yY][yY][yY][yY]-[mM?X][mM?X]-[dD?X][dD?X]/)) do |match|
    1082 #                 OpenEhr::LOG.info("V_ISO8601_DATE_CONSTRAINT_PATTERN: #{match}")
    1083 #                 [:V_ISO8601_DATE_CONSTRAINT_PATTERN, match]
    1084 #               end
    1085 #             end
    1086 #           end
    1087 #         end
    1088 
    1089 #         #V_ISO8601_TIME_CONSTRAINT_PATTERN /\A[hH][hH]:[mM?X][mM?X]:[sS?X][sS?X]/
    1090 #         class V_ISO8601_TIME_CONSTRAINT_PATTERN
    1091 #           include Yaparc::Parsable
    1092 #           def initialize
    1093 #             @parser = lambda do |input|
    1094 #               Yaparc::Apply.new(Yaparc::Regex.new(/\A[hH][hH]:[mM?X][mM?X]:[sS?X][sS?X]/)) do |match|
    1095 #                 OpenEhr::LOG.info("V_ISO8601_TIME_CONSTRAINT_PATTERN: #{match}")
    1096 #                 [:V_ISO8601_TIME_CONSTRAINT_PATTERN, match]
    1097 #               end
    1098 #             end
    1099 #           end
    1100 #         end
    1101 
    1102 #         #V_ISO8601_DURATION_CONSTRAINT_PATTERN
    1103 #         class V_ISO8601_DURATION_CONSTRAINT_PATTERN
    1104 #           include Yaparc::Parsable
    1105 #           def initialize
    1106 #             @parser = lambda do |input|
    1107 #               Yaparc::Apply.new(Yaparc::Alt.new(Yaparc::Regex.new(/\AP[yY]?[mM]?[wW]?[dD]?T[hH]?[mM]?[sS]?/),
    1108 #                                                 Yaparc::Regex.new(/\AP[yY]?[mM]?[wW]?[dD]?/))) do |match|
    1109 #                 OpenEhr::LOG.info("V_ISO8601_DURATION_CONSTRAINT_PATTERN: #{match}")
    1110 #                 [:V_ISO8601_DURATION_CONSTRAINT_PATTERN, match]
    1111 #               end
    1112 #             end
    1113 #           end
    1114 #         end
    1115 
    1116 #         #V_C_DOMAIN_TYPE /\A[A-Z][a-zA-Z0-9_]*[ \n]*\</
    1117 #         class V_C_DOMAIN_TYPE
    1118 #           include Yaparc::Parsable
    1119 #           def initialize
    1120 #             @parser = lambda do |input|
    1121 #               Yaparc::Apply.new(Yaparc::Regex.new(/\A[A-Z][a-zA-Z0-9_]*[ \n]*\</)) do |match|
    1122 #                 OpenEhr::LOG.info("V_C_DOMAIN_TYPE: #{match}")
    1123 #                 [:START_V_C_DOMAIN_TYPE_BLOCK, match]
    1124 #               end
    1125 #             end
    1126 #           end
    1127 #         end
    1128 
    1129 #         #
    1130 #         # CADL::RootScanner
    1131 #         #
    1132 #         class RootScanner
    1133 #           include Yaparc::Parsable
    1134 #           def initialize
    1135 #             @parser = lambda do |input|
    1136 #               Yaparc::Alt.new(V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN.new,
    1137 #                               V_ISO8601_DATE_CONSTRAINT_PATTERN.new,
    1138 #                               V_ISO8601_TIME_CONSTRAINT_PATTERN.new,
    1139 #                               OpenEhr::ADL::Scanner::Common::V_ISO8601_DURATION.new,
    1140 #                               V_C_DOMAIN_TYPE.new,
    1141 #                               V_ISO8601_DURATION_CONSTRAINT_PATTERN.new,
    1142 #                               Reserved.new,
    1143 #                               OpenEhr::ADL::Scanner::Common::V_QUALIFIED_TERM_CODE_REF.new,
    1144 #                               OpenEhr::ADL::Scanner::Common::V_LOCAL_TERM_CODE_REF.new,
    1145 #                               OpenEhr::ADL::Scanner::Common::ERR_V_QUALIFIED_TERM_CODE_REF.new,
    1146 #                               OpenEhr::ADL::Scanner::Common::V_TYPE_IDENTIFIER.new,
    1147 #                               OpenEhr::ADL::Scanner::Common::V_GENERIC_TYPE_IDENTIFIER.new,
    1148 #                               OpenEhr::ADL::Scanner::Common::V_STRING.new,
    1149 #                               OpenEhr::ADL::Scanner::Common::V_LOCAL_CODE.new,
    1150 #                               OpenEhr::ADL::Scanner::Common::V_REAL.new,
    1151 #                               OpenEhr::ADL::Scanner::Common::V_ISO8601_DURATION.new#,
    1152 #                               #OpenEhr::ADL::Scanner::Common::START_TERM_CODE_CONSTRAINT.new
    1153 #                               )
    1154 #             end
    1155 #           end
    1156 #         end
    1157 
    1158 #         # <CADL::Reserved class>
    1159 #         class Reserved
    1160 #           include Yaparc::Parsable
    1161          
    1162 #           def initialize
    1163 #             @parser = lambda do |input|
    1164 #               orderd_reserved = RESERVED.keys.sort{|x,y| y.length <=> x.length  }
    1165 #               reserved_parsers = orderd_reserved.map do |keyword|
    1166 #                 Yaparc::Literal.new(keyword,false)
    1167 #               end
    1168 #               Yaparc::Alt.new(Yaparc::Apply.new(Yaparc::Alt.new(*reserved_parsers)) do |match|
    1169 #                                 OpenEhr::LOG.info("Reserved: #{match}")
    1170 #                                 [OpenEhr::ADL::Scanner::CADL::RESERVED[match], OpenEhr::ADL::Scanner::CADL::RESERVED[match]]
    1171 #                               end,
    1172 #                               Yaparc::Apply.new(Yaparc::Regex.new(/\A[a-z][a-zA-Z0-9_]*/)) do |match|
    1173 #                                 OpenEhr::LOG.info("V_ATTRIBUTE_IDENTIFIER: #{match}")
    1174 #                                 [:V_ATTRIBUTE_IDENTIFIER, match]
    1175 #                               end)
    1176 #             end
    1177 #           end
    1178 #         end
    1179 
    1180 #       end
    1181 
    1182 
  • ruby/trunk/lib/adl_parser/lib/parser.rb

    r321 r323  
    2727    class Parser < Racc::Parser
    2828
    29 module_eval(<<'...end parser.y/module_eval...', 'parser.y', 1317)
     29module_eval(<<'...end parser.y/module_eval...', 'parser.y', 1318)
    3030
    3131def assert_at(file,line, message = "")
     
    4343end
    4444
    45 
    46 ###----------/* keywords */ ---------------------------------------------
    47 ### @@adl_reserved = {
    48 ###     'archetype' => :SYM_ARCHETYPE,
    49 ###     'adl_version' => :SYM_ADL_VERSION,
    50 ###     'controlled' => :SYM_IS_CONTROLLED,
    51 ###     'specialize' => :SYM_SPECIALIZE,
    52 ###     'concept' => :SYM_CONCEPT,
    53 ###     'language' => :SYM_LANGUAGE,
    54 ###     'description' => :SYM_DESCRIPTION,
    55 ###     'definition' => :SYM_DEFINITION,
    56 ###     'invariant' => :SYM_INVARIANT,
    57 ###     'ontology' => :SYM_ONTOLOGY,
    58 ###     'matches' => :SYM_MATCHES,
    59 ###     'is_in' => :SYM_MATCHES,
    60 ###     'occurrences' => :SYM_OCCURRENCES,
    61 ###     'true' => :SYM_TRUE, #[Tt][Rr][Uu][Ee] -- -> SYM_TRUE
    62 ###     'false' => :SYM_FALSE, # [Ff][Aa][Ll][Ss][Ee] -- -> SYM_FALSE
    63 ###     'infinity' => :SYM_INFINITY # [Ii][Nn][Ff][Ii][Nn][Ii][Tt][Yy] -- -> SYM_INFINITY
    64 ### }
    65 
    66 ### @@dadl_reserved = {
    67 ###   'true' => :SYM_TRUE, #[Tt][Rr][Uu][Ee] -- -> SYM_TRUE
    68 ###   'false' => :SYM_FALSE, # [Ff][Aa][Ll][Ss][Ee] -- -> SYM_FALSE
    69 ###   'infinity' => :SYM_INFINITY # [Ii][Nn][Ff][Ii][Nn][Ii][Tt][Yy] -- -> SYM_INFINITY
    70 ### }
    71 
    72 ### @@cadl_reserved = {
    73 ###   'then' => :SYM_THEN, # [Tt][Hh][Ee][Nn]
    74 ###   'else' => :SYM_ELSE, # [Ee][Ll][Ss][Ee]
    75 ###   'and' => :SYM_AND, # [Aa][Nn][Dd]
    76 ###   'or' => :SYM_OR, # [Oo][Rr]
    77 ###   'xor' => :SYM_XOR, # [Xx][Oo][Rr]
    78 ###   'not' => :SYM_NOT, # [Nn][Oo][Tt]
    79 ###   'implies' => :SYM_IMPLIES, # [Ii][Mm][Pp][Ll][Ii][Ee][Ss]
    80 ###   'true' => :SYM_TRUE, #[Tt][Rr][Uu][Ee] -- -> SYM_TRUE
    81 ###   'false' => :SYM_FALSE, # [Ff][Aa][Ll][Ss][Ee] -- -> SYM_FALSE
    82 ###   'forall' => :SYM_FORALL, # [Ff][Oo][Rr][_][Aa][Ll][Ll]
    83 ###   'exists' => :SYM_EXISTS, # [Ee][Xx][Ii][Ss][Tt][Ss]
    84 ###   'existence' => :SYM_EXISTENCE, # [Ee][Xx][Iu][Ss][Tt][Ee][Nn][Cc][Ee]
    85 ###   'occurrences' => :SYM_OCCURRENCES, # [Oo][Cc][Cc][Uu][Rr][Rr][Ee][Nn][Cc][Ee][Ss]
    86 ###   'cardinality' => :SYM_CARDINALITY, # [Cc][Aa][Rr][Dd][Ii][Nn][Aa][Ll][Ii][Tt][Yy]
    87 ###   'ordered' => :SYM_ORDERED, # [Oo][Rr][Dd][Ee][Rr][Ee][Dd]
    88 ###   'unordered' => :SYM_UNORDERED, # [Uu][Nn][Oo][Rr][Dd][Ee][Rr][Ee][Dd]
    89 ###   'unique' => :SYM_UNIQUE, # [Uu][Nn][Ii][Qq][Uu][Ee]
    90 ###   'matches' => :SYM_MATCHES, # [Mm][Aa][Tt][Cc][Hh][Ee][Ss]
    91 ###   'is_in' => :SYM_MATCHES, # [Ii][Ss][_][Ii][Nn]
    92 ###   'invariant' => :SYM_INVARIANT, # [Ii][Nn][Vv][Aa][Rr][Ii][Aa][Nn][Tt]
    93 ###   'infinity' => :SYM_INFINITY, # [Ii][Nn][Ff][Ii][Nn][Ii][Tt][Yy] -- -> SYM_INFINITY
    94 ###   'use_node' => :SYM_USE_NODE, # [Uu][Ss][Ee][_][Nn][Oo][Dd][Ee]
    95 ###   'use_archetype' => :SYM_ALLOW_ARCHETYPE, # [Uu][Ss][Ee][_][Aa][Rr][Cc][Hh][Ee][Tt][Yy][Pp][Ee]
    96 ###   'allow_archetype' => :SYM_ALLOW_ARCHETYPE, # [Aa][Ll][Ll][Oo][Ww][_][Aa][Rr][Cc][Hh][Ee][Tt][Yy][Pp][Ee]
    97 ###   'include' => :SYM_INCLUDE, # [Ii][Nn][Cc][Ll][Uu][Dd][Ee]
    98 ###   'exclude' => :SYM_EXCLUDE # [Ee][Xx][Cc][Ll][Uu][Dd][Ee]
    99 ### }
    10045
    10146
     
    15297
    15398racc_action_table = [
    154    514,   493,   133,   466,   164,   588,   464,   460,   129,   462,
    155     57,   374,   228,   327,   475,    10,   568,   169,   170,   167,
    156    168,   433,    29,   109,   511,   183,   108,   508,   524,   415,
    157    509,   510,    71,   431,    66,    12,   537,   512,    49,   515,
    158    517,   314,   569,    59,   491,   229,    95,    98,   567,   134,
    159     30,    46,    47,   309,    49,   571,    78,    81,    84,   187,
     99   569,   433,   472,   466,    10,   588,   464,   460,   228,   462,
     100   129,   477,   568,   571,   475,   212,     1,   374,   333,    57,
     101    29,   493,   330,   388,    12,   380,   381,   431,   524,    93,
     102   114,   183,    71,   112,   478,     5,   537,   512,   213,   515,
     103   517,   229,   514,   511,   567,    59,   508,    49,    30,   509,
     104   510,    46,    47,   309,   491,   127,    78,    81,    84,   187,
    160105   117,    93,   295,   301,    75,   109,   112,   114,   117,   532,
    161106   524,   117,   109,   114,    71,   112,   123,   124,   537,   512,
    162    117,   515,   517,   117,   101,   109,   307,   270,   271,   534,
    163    161,   114,   283,    46,    47,   309,    71,   230,    78,    81,
    164     84,   187,   114,    93,   295,   301,    99,   109,   112,   114,
    165    117,   532,   152,    66,   373,    46,    47,   101,   477,   142,
    166     78,    81,    84,   429,   117,    93,    95,    98,   307,   270,
    167    271,   534,   489,    49,   283,    88,    91,   152,   487,   139,
    168    152,   478,    76,   156,   157,   152,   217,   148,   155,   472,
    169    151,   153,   152,    78,    81,    84,   236,   158,    93,    95,
    170     98,   114,   159,   152,   143,   150,   456,   152,    88,    91,
    171    156,   157,   458,   155,   148,    76,   155,   151,   153,   152,
    172    112,   155,    78,    81,    84,   147,   149,    93,   155,   112,
    173    150,   152,   594,   150,   109,   236,   183,   577,   150,   155,
    174    166,   330,   127,   155,    76,   150,   576,   447,   154,   565,
    175    147,   149,   112,   147,   149,   155,   150,  -373,   147,   149,
    176    150,   217,    78,   376,   377,   147,   149,   155,   448,   380,
    177    381,   217,   150,    93,   371,   154,   147,   149,   112,   258,
    178    147,   149,   250,   212,   150,   254,   255,   117,    78,   376,
    179    377,    35,   147,   149,    78,   376,   377,    78,    81,    84,
    180     46,    47,    93,   101,   147,   149,   213,    78,    81,    84,
    181    265,   109,    93,   144,   126,   564,   380,   381,   145,    76,
    182     93,   101,   237,    49,    20,   139,    78,    81,    84,    76,
    183    217,    93,    46,    47,   495,   109,   112,   114,   117,    78,
    184     81,    84,    21,    99,    93,    95,    98,    16,   101,    17,
    185      1,   324,    46,    47,    88,    91,   217,    78,    81,    84,
    186    126,    76,    93,    95,    98,   319,    78,    81,    84,     5,
    187    139,    93,    88,    91,   217,   169,   170,   167,   168,    76,
    188    217,    78,   376,   377,    78,    81,    84,   217,    76,    93,
    189     95,    98,    78,    81,    84,   209,   333,    93,   217,    88,
    190     91,   496,   171,   380,   381,    35,    76,    93,   114,   310,
    191     78,    81,    84,   102,    76,    93,    78,    81,    84,  -374,
    192    390,    93,   101,    78,    81,    84,   380,   381,    93,    16,
    193     93,    17,    76,    54,    78,    81,    84,    49,    76,    93,
    194    101,   424,   425,    35,   139,    76,    46,    47,   391,   380,
    195    381,    39,   392,    93,    46,    47,    76,   393,    78,    81,
    196     84,    35,    99,    93,    95,    98,   380,   381,   101,   394,
    197     93,    46,    47,    88,    91,    49,    78,    81,    84,   411,
    198     76,    93,    95,    98,    46,    47,   101,   416,   417,   102,
    199     99,    88,    91,    49,    78,   376,   377,   395,    76,    46,
    200     47,   396,    46,    47,    78,    81,    84,   397,    99,    93,
    201     95,    98,   398,   373,   101,   470,   399,    46,    47,    88,
    202     91,   400,    78,    81,    84,   262,    76,    93,    95,    98,
    203     46,    47,   101,   386,   322,   385,    99,    88,    91,   401,
    204    217,   123,   124,   402,    76,    46,    47,   411,   422,   423,
    205     78,    81,    84,   264,   139,    93,    95,    98,   101,   614,
    206    615,   616,   410,   376,   377,    88,    91,   265,    78,    81,
    207     84,   411,    76,    93,    95,    98,    78,    81,    84,   268,
    208    139,    93,   101,    88,    91,   266,   410,   376,   377,   403,
    209     76,   217,   418,   419,    78,    81,    84,   404,    76,    93,
    210     95,    98,   420,   421,   139,   217,    78,   376,   377,    88,
    211     91,   388,   405,   380,   381,   316,    76,    93,    78,    81,
    212     84,   426,   427,    93,    95,    98,   408,    78,    81,    84,
    213     46,    47,    93,    88,    91,   169,   170,   167,   168,   269,
    214     76,    78,    81,    84,   335,   336,    93,   309,   268,    76,
    215     78,    81,    84,   187,   267,    93,   295,   301,   266,   109,
    216    112,   114,   117,    76,    78,    81,    84,   314,   316,    93,
    217     78,   376,   377,   109,   112,   114,   117,    78,   376,   377,
    218    307,   270,   271,  -104,   343,   344,   283,   202,   345,   346,
    219     78,    81,    84,   187,   265,    93,   123,   124,   126,   109,
    220    112,   114,   117,   183,   120,   127,   347,   348,    78,    81,
    221     84,    25,    26,    93,   123,   124,   126,   109,   112,   114,
    222    117,   264,   120,    78,    81,    84,   596,   597,    93,    78,
    223    376,   377,   109,   112,   114,   117,    78,    81,    84,   361,
    224    362,    93,   363,   364,   263,   109,   112,   114,   117,    78,
    225     81,    84,   123,   124,    93,   624,   625,   262,   109,   112,
    226    114,   117,   383,    78,   376,   377,   169,   170,   167,   168,
    227    169,   170,   167,   168,   169,   170,   167,   168,   169,   170,
    228    167,   168,   261,   260,   259,   248,   434,   435,   436,   437,
    229    438,   439,   440,   441,   442,   443,   444,   445,   247,   246,
     107   117,   515,   517,   314,   101,   114,   307,   270,   271,   534,
     108   161,   458,   283,    46,    47,   309,    71,   230,    78,    81,
     109    84,   187,   117,    93,   295,   301,    99,   109,   112,   114,
     110   117,   532,   114,   565,   448,    46,    47,   101,   158,   373,
     111    78,    81,    84,   159,   429,    93,    95,    98,   307,   270,
     112   271,   534,   594,    20,   283,    88,    91,   156,   157,   139,
     113   415,   148,    76,   456,   152,   153,   142,   489,   380,   381,
     114   236,    21,    93,    78,    81,    84,   217,   117,    93,    95,
     115    98,   487,   380,   381,    46,    47,    93,   164,    88,    91,
     116   155,   258,   156,   157,   250,    76,   148,   254,   255,   152,
     117   153,   112,   373,   102,   470,   114,   150,   151,    78,   376,
     118   377,   143,    78,    81,    84,   217,   109,    93,   495,    78,
     119   376,   377,   154,   217,   112,   155,    39,   147,   149,    95,
     120    98,   183,   133,   101,    76,   112,    35,   109,    78,    81,
     121    84,   150,   151,    93,    46,    47,   109,   109,   112,   114,
     122   117,    78,    81,    84,   496,   139,    93,   154,   101,    78,
     123    81,    84,   147,   149,    93,    78,   376,   377,    49,    78,
     124    81,    84,    66,    76,    93,    95,    98,    46,    47,   134,
     125   139,    76,   101,   327,    88,    91,   126,    16,   447,    17,
     126   217,    76,    49,   109,    78,    81,    84,   319,   371,    93,
     127    95,    98,   380,   381,    99,   217,    93,   209,   310,    88,
     128    91,   117,   324,    46,    47,   217,    76,    35,    78,    81,
     129    84,   126,   108,    93,    95,    98,    78,    81,    84,   217,
     130    66,    93,   390,    88,    91,    78,   376,   377,   101,   391,
     131    76,    78,    81,    84,   102,   166,    93,   171,    76,    49,
     132    49,    78,    81,    84,   392,   386,    93,   385,    46,    47,
     133   139,   101,  -373,    76,  -374,    78,    81,    84,   577,   217,
     134    93,   393,    54,    76,    78,    81,    84,   576,   394,    93,
     135    95,    98,    35,    99,   217,    46,    47,    76,   395,    88,
     136    91,   396,    46,    47,   217,   265,    76,    78,    81,    84,
     137   564,   397,    93,    95,    98,    78,    81,    84,   217,    35,
     138    93,   144,    88,    91,    49,   398,   145,   101,   399,    76,
     139    78,    81,    84,    46,    47,    93,    16,    76,    17,   322,
     140    78,    81,    84,   400,   237,    93,   123,   124,   262,   139,
     141   101,    49,    76,   401,    78,    81,    84,   418,   419,    93,
     142    46,    47,    76,    78,    81,    84,    46,    47,    93,    95,
     143    98,   402,    99,   101,   416,   417,    76,   264,    88,    91,
     144   265,    46,    47,    25,    26,    76,    78,    81,    84,   268,
     145   155,    93,    95,    98,   266,    99,   101,   169,   170,   167,
     146   168,    88,    91,   403,    46,    47,   150,   151,    76,    78,
     147    81,    84,   314,   316,    93,    95,    98,   404,   139,   101,
     148   420,   421,   380,   381,    88,    91,    93,   147,   149,   155,
     149   405,    76,    78,    81,    84,   422,   423,    93,    95,    98,
     150   316,    99,   101,   335,   336,   150,   151,    88,    91,   408,
     151    46,    47,   236,   269,    76,    78,    81,    84,   155,   268,
     152    93,    95,    98,   267,   139,   217,   147,   149,   424,   425,
     153    88,    91,   155,   266,   150,   151,   265,    76,    78,    81,
     154    84,   343,   344,    93,    95,    98,   380,   381,   150,   151,
     155    93,   155,   264,    88,    91,   147,   149,   155,   345,   346,
     156    76,    78,    81,    84,   347,   348,    93,   150,   151,   147,
     157   149,   263,   309,   150,   151,    78,    81,    84,   187,   262,
     158    93,   295,   301,    76,   109,   112,   114,   117,   147,   149,
     159   596,   597,   155,   261,   147,   149,   260,   411,   380,   381,
     160   411,   259,    93,   411,   248,   307,   270,   271,   150,   151,
     161   434,   283,   410,   376,   377,    78,   376,   377,   410,   376,
     162   377,   614,   615,   616,  -104,    78,   376,   377,   202,   147,
     163   149,    78,    81,    84,   187,   435,    93,   123,   124,   126,
     164   109,   112,   114,   117,   183,   120,   127,   123,   124,    78,
     165    81,    84,   361,   362,    93,   123,   124,   126,   109,   112,
     166   114,   117,   436,   120,    78,    81,    84,   363,   364,    93,
     167    78,   376,   377,   109,   112,   114,   117,    78,    81,    84,
     168   426,   427,    93,    78,   376,   377,   109,   112,   114,   117,
     169    78,    81,    84,   624,   625,    93,    78,   376,   377,   109,
     170   112,   114,   117,    78,    81,    84,   437,   438,    93,   439,
     171   440,   441,   109,   112,   114,   117,   169,   170,   167,   168,
     172   169,   170,   167,   168,   169,   170,   167,   168,   383,    78,
     173   376,   377,   169,   170,   167,   168,   169,   170,   167,   168,
     174   169,   170,   167,   168,   442,   443,   444,   445,   247,   246,
    230175   450,   451,   452,   453,   454,   455,   144,   158,   145,   159,
    231176   245,   244,   243,   242,   241,   240,   468,   239,   471,   238,
     
    243188
    244189racc_action_check = [
    245    477,   423,    68,   396,    91,   563,   395,   393,    60,   394,
    246     40,   261,   161,   243,   401,     5,   525,   234,   234,   234,
    247    234,   348,    23,   243,   468,   261,    58,   468,   477,   336,
    248    468,   468,   477,   346,    58,     5,   477,   477,    40,   477,
    249    477,   477,   529,    60,   421,   161,    91,    91,   525,    68,
    250     23,   477,   477,   477,    58,   529,   477,   477,   477,   477,
    251    423,   477,   477,   477,    53,   477,   477,   477,   477,   477,
    252    529,   396,   393,   395,   529,   394,   401,   401,   529,   529,
    253    348,   529,   529,   468,    53,   336,   477,   477,   477,   477,
    254    563,   346,   477,   529,   529,   529,    53,   165,   529,   529,
    255    529,   529,   421,   529,   529,   529,    53,   529,   529,   529,
    256    529,   529,   226,    48,   260,    53,    53,   165,   404,    80,
    257     53,    53,    53,   344,   246,    53,    53,    53,   529,   529,
    258    529,   529,   419,    48,   529,    53,    53,   227,   417,   165,
    259    172,   404,    53,   172,   172,   224,   149,   172,   226,   400,
    260    172,   172,   223,   165,   165,   165,   172,    84,   165,   165,
    261    165,   244,    84,   218,    80,   226,   390,    83,   165,   165,
    262     83,    83,   392,   227,    83,   165,   172,    83,    83,   318,
    263    344,   224,   149,   149,   149,   226,   226,   149,   223,   419,
    264    227,   221,   568,   172,   417,   318,   263,   539,   224,   218,
    265     94,   245,   400,    83,   149,   223,   539,   362,   172,   517,
    266    227,   227,   245,   172,   172,   318,   218,    94,   224,   224,
    267     83,   153,   390,   390,   390,   223,   223,   221,   364,   392,
    268    392,   152,   318,   392,   259,    83,   218,   218,   242,   187,
    269     83,    83,   187,   142,   221,   187,   187,   259,   568,   568,
    270    568,   512,   318,   318,   362,   362,   362,   153,   153,   153,
    271    517,   517,   153,   170,   221,   221,   142,   152,   152,   152,
    272    516,   240,   152,    81,   238,   516,   364,   364,    81,   153,
    273    364,   611,   173,   512,    13,   170,   187,   187,   187,   152,
    274    151,   187,   512,   512,   425,   187,   187,   187,   187,   170,
    275    170,   170,    13,   611,   170,   170,   170,    26,   168,    26,
    276      0,   241,   611,   611,   170,   170,   150,   611,   611,   611,
    277    241,   170,   611,   611,   611,   229,   151,   151,   151,     0,
    278    168,   151,   611,   611,   156,   173,   173,   173,   173,   611,
    279    157,   425,   425,   425,   168,   168,   168,   148,   151,   168,
    280    168,   168,   150,   150,   150,   135,   247,   150,   147,   168,
    281    168,   427,    99,   496,   496,   135,   168,   496,   247,   213,
    282    156,   156,   156,    56,   150,   156,   157,   157,   157,    99,
    283    272,   157,   164,   148,   148,   148,   264,   264,   148,    12,
    284    264,    12,   156,    34,   147,   147,   147,   135,   157,   147,
    285    612,   341,   341,    34,   164,   148,   135,   135,   273,   427,
    286    427,    28,   275,   427,    56,    56,   147,   278,   164,   164,
    287    164,    28,   612,   164,   164,   164,   448,   448,    79,   281,
    288    448,   612,   612,   164,   164,    34,   612,   612,   612,   482,
    289    164,   612,   612,   612,    34,    34,   605,   337,   337,   131,
    290     79,   612,   612,    28,   482,   482,   482,   285,   612,    79,
    291     79,   288,    28,    28,    79,    79,    79,   291,   605,    79,
    292     79,    79,   293,   398,   617,   398,   295,   605,   605,    79,
    293     79,   296,   605,   605,   605,   298,    79,   605,   605,   605,
    294    131,   131,   169,   266,   239,   266,   617,   605,   605,   300,
    295    217,   239,   239,   301,   605,   617,   617,   319,   340,   340,
    296    617,   617,   617,   303,   169,   617,   617,   617,   167,   609,
    297    609,   609,   319,   319,   319,   617,   617,   304,   169,   169,
    298    169,   578,   617,   169,   169,   169,   217,   217,   217,   308,
    299    167,   217,   101,   169,   169,   309,   578,   578,   578,   310,
    300    169,   155,   338,   338,   167,   167,   167,   311,   217,   167,
    301    167,   167,   339,   339,   101,   154,   495,   495,   495,   167,
    302    167,   268,   312,   268,   268,   315,   167,   268,   101,   101,
    303    101,   342,   342,   101,   101,   101,   316,   155,   155,   155,
    304    515,   515,   155,   101,   101,   235,   235,   235,   235,   211,
    305    101,   154,   154,   154,   249,   249,   154,   212,   205,   155,
    306    212,   212,   212,   212,   204,   212,   212,   212,   202,   212,
    307    212,   212,   212,   154,   258,   258,   258,   215,   215,   258,
    308    447,   447,   447,   258,   258,   258,   258,   262,   262,   262,
    309    212,   212,   212,   102,   251,   251,   212,   102,   252,   252,
    310    102,   102,   102,   102,   201,   102,   102,   102,   102,   102,
    311    102,   102,   102,   102,   102,    59,   253,   253,    59,    59,
    312     59,    18,    18,    59,    59,    59,    59,    59,    59,    59,
    313     59,   200,    59,   254,   254,   254,   572,   572,   254,   567,
    314    567,   567,   254,   254,   254,   254,   250,   250,   250,   256,
    315    256,   250,   257,   257,   198,   250,   250,   250,   250,   255,
    316    255,   255,   267,   267,   255,   621,   621,   197,   255,   255,
    317    255,   255,   265,   265,   265,   265,    96,    96,    96,    96,
    318    233,   233,   233,   233,   232,   232,   232,   232,   231,   231,
    319    231,   231,   195,   194,   189,   186,   349,   350,   351,   352,
    320    353,   354,   355,   356,   357,   358,   359,   360,   185,   184,
     190   529,   348,   400,   396,     5,   563,   395,   393,   161,   394,
     191    60,   404,   525,   529,   401,   142,     0,   261,   247,    40,
     192    23,   423,   245,   268,     5,   268,   268,   346,   529,   268,
     193   247,   261,   529,   245,   404,     0,   529,   529,   142,   529,
     194   529,   161,   477,   468,   525,    60,   468,    40,    23,   468,
     195   468,   529,   529,   529,   421,   400,   529,   529,   529,   529,
     196   348,   529,   529,   529,    53,   529,   529,   529,   529,   529,
     197   477,   396,   393,   395,   477,   394,   401,   401,   477,   477,
     198   423,   477,   477,   477,    53,   346,   529,   529,   529,   529,
     199   563,   392,   529,   477,   477,   477,    53,   165,   477,   477,
     200   477,   477,   468,   477,   477,   477,    53,   477,   477,   477,
     201   477,   477,   421,   517,   364,    53,    53,   165,    84,   260,
     202    53,    53,    53,    84,   344,    53,    53,    53,   477,   477,
     203   477,   477,   568,    13,   477,    53,    53,   172,   172,   165,
     204   336,   172,    53,   390,   172,   172,    80,   419,   392,   392,
     205   172,    13,   392,   165,   165,   165,   148,   246,   165,   165,
     206   165,   417,   364,   364,   517,   517,   364,    91,   165,   165,
     207   172,   187,    83,    83,   187,   165,    83,   187,   187,    83,
     208    83,   344,   398,    56,   398,   244,   172,   172,   568,   568,
     209   568,    80,   148,   148,   148,   153,   336,   148,   425,   390,
     210   390,   390,   172,   152,   419,    83,    28,   172,   172,    91,
     211    91,   263,    68,   168,   148,   242,    28,   417,   187,   187,
     212   187,    83,    83,   187,    56,    56,   240,   187,   187,   187,
     213   187,   153,   153,   153,   427,   168,   153,    83,   170,   152,
     214   152,   152,    83,    83,   152,   425,   425,   425,    28,   168,
     215   168,   168,    48,   153,   168,   168,   168,    28,    28,    68,
     216   170,   152,   611,   243,   168,   168,   238,    12,   362,    12,
     217   150,   168,    48,   243,   170,   170,   170,   229,   259,   170,
     218   170,   170,   427,   427,   611,   149,   427,   135,   213,   170,
     219   170,   259,   241,   611,   611,   154,   170,   135,   611,   611,
     220   611,   241,    58,   611,   611,   611,   150,   150,   150,   147,
     221    58,   150,   272,   611,   611,   362,   362,   362,   169,   273,
     222   611,   149,   149,   149,   131,    94,   149,    99,   150,   135,
     223    58,   154,   154,   154,   275,   266,   154,   266,   135,   135,
     224   169,   612,    94,   149,    99,   147,   147,   147,   539,   155,
     225   147,   278,    34,   154,   169,   169,   169,   539,   281,   169,
     226   169,   169,    34,   612,   217,   131,   131,   147,   285,   169,
     227   169,   288,   612,   612,   156,   516,   169,   612,   612,   612,
     228   516,   291,   612,   612,   612,   155,   155,   155,   157,   512,
     229   155,    81,   612,   612,    34,   293,    81,   101,   295,   612,
     230   217,   217,   217,    34,    34,   217,    26,   155,    26,   239,
     231   156,   156,   156,   296,   173,   156,   239,   239,   298,   101,
     232   617,   512,   217,   300,   157,   157,   157,   338,   338,   157,
     233   512,   512,   156,   101,   101,   101,   515,   515,   101,   101,
     234   101,   301,   617,    79,   337,   337,   157,   303,   101,   101,
     235   304,   617,   617,    18,    18,   101,   617,   617,   617,   308,
     236   218,   617,   617,   617,   309,    79,   164,   173,   173,   173,
     237   173,   617,   617,   310,    79,    79,   218,   218,   617,    79,
     238    79,    79,   215,   215,    79,    79,    79,   311,   164,   605,
     239   339,   339,   496,   496,    79,    79,   496,   218,   218,   223,
     240   312,    79,   164,   164,   164,   340,   340,   164,   164,   164,
     241   315,   605,   167,   249,   249,   223,   223,   164,   164,   316,
     242   605,   605,   318,   211,   164,   605,   605,   605,   222,   205,
     243   605,   605,   605,   204,   167,   151,   223,   223,   341,   341,
     244   605,   605,   318,   202,   222,   222,   201,   605,   167,   167,
     245   167,   251,   251,   167,   167,   167,   448,   448,   318,   318,
     246   448,   226,   200,   167,   167,   222,   222,   227,   252,   252,
     247   167,   151,   151,   151,   253,   253,   151,   226,   226,   318,
     248   318,   198,   212,   227,   227,   212,   212,   212,   212,   197,
     249   212,   212,   212,   151,   212,   212,   212,   212,   226,   226,
     250   572,   572,   224,   195,   227,   227,   194,   578,   264,   264,
     251   482,   189,   264,   319,   186,   212,   212,   212,   224,   224,
     252   349,   212,   578,   578,   578,   482,   482,   482,   319,   319,
     253   319,   609,   609,   609,   102,   495,   495,   495,   102,   224,
     254   224,   102,   102,   102,   102,   350,   102,   102,   102,   102,
     255   102,   102,   102,   102,   102,   102,    59,   267,   267,    59,
     256    59,    59,   256,   256,    59,    59,    59,    59,    59,    59,
     257    59,    59,   351,    59,   254,   254,   254,   257,   257,   254,
     258   447,   447,   447,   254,   254,   254,   254,   250,   250,   250,
     259   342,   342,   250,   262,   262,   262,   250,   250,   250,   250,
     260   255,   255,   255,   621,   621,   255,   567,   567,   567,   255,
     261   255,   255,   255,   258,   258,   258,   352,   353,   258,   354,
     262   355,   356,   258,   258,   258,   258,    96,    96,    96,    96,
     263   235,   235,   235,   235,   234,   234,   234,   234,   265,   265,
     264   265,   265,   231,   231,   231,   231,   232,   232,   232,   232,
     265   233,   233,   233,   233,   357,   358,   359,   360,   185,   184,
    321266   365,   366,   367,   368,   369,   370,   376,   377,   380,   381,
    322267   182,   181,   180,   179,   178,   177,   397,   175,   399,   174,
     
    334279
    335280racc_action_pointer = [
    336    309,   nil,   862,   876,   857,    14,   847,   nil,   872,   nil,
    337    nil,   nil,   365,   283,   834,   nil,   851,   nil,   649,   nil,
    338    nil,   nil,   828,    21,   832,   nil,   283,   823,   410,   nil,
    339    nil,   nil,   nil,   812,   392,   791,   nil,   nil,   832,   nil,
    340     -5,   nil,   nil,   nil,   789,   826,   nil,   nil,    90,   835,
    341    nil,   nil,   788,    63,   nil,   nil,   362,   nil,    11,   611,
    342     -7,   nil,   825,   nil,   nil,   nil,   779,   nil,     1,   772,
    343    nil,   776,   nil,   nil,   nil,   nil,   763,   nil,   nil,   407,
    344     85,   216,   771,   161,   100,   nil,   717,   nil,   723,   nil,
    345    nil,   -17,   748,   nil,   171,   nil,   651,   nil,   nil,   333,
    346    nil,   521,   593,   nil,   nil,   nil,   782,   nil,   nil,   nil,
     281    15,   nil,   862,   876,   857,     3,   847,   nil,   872,   nil,
     282   nil,   nil,   243,   132,   834,   nil,   851,   nil,   431,   nil,
     283   nil,   nil,   828,    19,   832,   nil,   382,   823,   205,   nil,
     284   nil,   nil,   nil,   812,   351,   791,   nil,   nil,   832,   nil,
     285     4,   nil,   nil,   nil,   789,   826,   nil,   nil,   229,   835,
     286   nil,   nil,   788,    63,   nil,   nil,   172,   nil,   287,   602,
     287    -5,   nil,   825,   nil,   nil,   nil,   779,   nil,   211,   772,
     288   nil,   776,   nil,   nil,   nil,   nil,   763,   nil,   nil,   422,
     289   112,   334,   771,   163,    61,   nil,   717,   nil,   723,   nil,
     290   nil,   146,   748,   nil,   296,   nil,   651,   nil,   nil,   298,
     291   nil,   376,   584,   nil,   nil,   nil,   782,   nil,   nil,   nil,
    347292   nil,   741,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    348293   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    349    nil,   438,   nil,   nil,   nil,   354,   nil,   756,   711,   760,
    350    nil,   nil,   231,   739,   nil,   nil,   768,   337,   326,   125,
    351    295,   269,   210,   200,   544,   530,   313,   319,   nil,   nil,
    352    nil,    11,   nil,   nil,   361,    96,   nil,   497,   287,   471,
    353    242,   nil,   134,   260,   724,   722,   nil,   720,   719,   718,
    354    717,   716,   715,   nil,   704,   703,   730,   229,   nil,   689,
    355    nil,   nil,   nil,   nil,   688,   687,   nil,   662,   649,   nil,
    356    626,   599,   563,   nil,   559,   553,   nil,   nil,   nil,   nil,
    357    nil,   563,   553,   333,   nil,   585,   nil,   479,   157,   nil,
    358    nil,   185,   nil,   146,   139,   nil,   106,   131,   nil,   313,
    359    nil,   663,   659,   655,   -58,   520,   nil,   nil,   209,   438,
    360    205,   255,   171,   -43,    93,   145,    55,   300,   nil,   544,
    361    639,   584,   588,   606,   626,   652,   639,   642,   567,   178,
    362     60,   -45,   580,   126,   328,   666,   439,   649,   515,   nil,
    363    nil,   nil,   357,   394,   nil,   389,   nil,   nil,   394,   nil,
    364    nil,   406,   nil,   nil,   nil,   434,   nil,   nil,   438,   nil,
    365    nil,   388,   nil,   417,   nil,   421,   458,   nil,   430,   nil,
    366    476,   448,   nil,   458,   472,   nil,   nil,   nil,   484,   490,
    367    535,   523,   558,   nil,   nil,   532,   505,   nil,   173,   465,
     294   nil,   313,   nil,   nil,   nil,   286,   nil,   756,   711,   760,
     295   nil,   nil,     3,   739,   nil,   nil,   768,   288,   135,   264,
     296   249,   514,   182,   174,   274,   328,   353,   367,   nil,   nil,
     297   nil,     7,   nil,   nil,   445,    96,   nil,   491,   192,   297,
     298   217,   nil,   128,   392,   724,   722,   nil,   720,   719,   718,
     299   717,   716,   715,   nil,   704,   703,   599,   161,   nil,   556,
     300   nil,   nil,   nil,   nil,   551,   548,   nil,   534,   526,   nil,
     301   507,   491,   488,   nil,   478,   474,   nil,   nil,   nil,   nil,
     302   nil,   487,   528,   252,   nil,   440,   nil,   343,   418,   nil,
     303   nil,   nil,   486,   457,   560,   nil,   519,   525,   nil,   265,
     304   nil,   667,   671,   675,   659,   655,   nil,   nil,   201,   353,
     305   160,   236,   148,   207,   117,   -34,    88,   -38,   nil,   453,
     306   630,   491,   508,   514,   617,   643,   602,   617,   656,   222,
     307    65,   -39,   636,   141,   550,   682,   281,   594,   -33,   nil,
     308   nil,   nil,   289,   305,   nil,   311,   nil,   nil,   328,   nil,
     309   nil,   335,   nil,   nil,   nil,   345,   nil,   nil,   348,   nil,
     310   nil,   302,   nil,   340,   nil,   343,   390,   nil,   363,   nil,
     311   400,   386,   nil,   392,   395,   nil,   nil,   nil,   404,   409,
     312   459,   453,   486,   nil,   nil,   467,   438,   nil,   500,   571,
    368313   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    369    nil,   nil,   nil,   nil,   nil,   nil,    19,   387,   492,   502,
    370    448,   341,   521,   nil,   113,   nil,    23,   nil,    11,   686,
    371    687,   688,   689,   690,   691,   692,   693,   694,   695,   696,
    372    697,   nil,   197,   nil,   218,   700,   701,   702,   703,   704,
     314   nil,   nil,   nil,   nil,   nil,   nil,   130,   384,   367,   430,
     315   445,   478,   630,   nil,   114,   nil,    17,   nil,    -9,   560,
     316   585,   612,   656,   657,   659,   660,   661,   694,   695,   696,
     317   697,   nil,   258,   nil,   104,   700,   701,   702,   703,   704,
    373318   705,   nil,   nil,   nil,   nil,   nil,   709,   710,   nil,   nil,
    374319   706,   707,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    375    165,   nil,   171,     6,     8,     5,     2,   716,   419,   714,
    376    148,    13,   718,   nil,   106,   nil,   nil,   701,   750,   nil,
    377    724,   nil,   nil,   772,   727,   722,   nil,   128,   nil,   122,
    378    nil,    34,   nil,    -9,   nil,   284,   nil,   351,   735,   729,
     320   142,   nil,    90,     6,     8,     5,     2,   716,   128,   714,
     321     1,    13,   718,   nil,    -1,   nil,   nil,   701,   750,   nil,
     322   724,   nil,   nil,   772,   727,   722,   nil,   151,   nil,   137,
     323   nil,    44,   nil,    11,   nil,   188,   nil,   224,   735,   729,
    379324   737,   730,   739,   731,   nil,   nil,   nil,   nil,   nil,   nil,
    380    nil,   nil,   nil,   nil,   nil,   nil,   741,   573,   368,   744,
     325   nil,   nil,   nil,   nil,   nil,   nil,   741,   623,   498,   744,
    381326   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    382    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,    14,   nil,
    383    nil,   nil,   nil,   nil,   nil,   nil,   nil,    -1,   771,   nil,
    384    774,   797,   397,   nil,   nil,   751,   752,   747,   754,   748,
    385    756,   749,   758,   750,   760,   509,   305,   763,   nil,   764,
     327   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,    33,   nil,
     328   nil,   nil,   nil,   nil,   nil,   nil,   nil,    41,   771,   nil,
     329   774,   797,   568,   nil,   nil,   751,   752,   747,   754,   748,
     330   756,   749,   758,   750,   760,   578,   434,   763,   nil,   764,
    386331   nil,   765,   nil,   766,   nil,   767,   768,   nil,   760,   761,
    387    762,   763,   240,   nil,   820,   538,   215,   208,   809,   nil,
    388    nil,   nil,   nil,   nil,   nil,    -7,   nil,   nil,   nil,    41,
    389    nil,   nil,   nil,   nil,   792,   808,   nil,   nil,   757,   183,
     332   762,   763,   378,   nil,   820,   384,   320,   112,   809,   nil,
     333   nil,   nil,   nil,   nil,   nil,   -11,   nil,   nil,   nil,    -1,
     334   nil,   nil,   nil,   nil,   792,   808,   nil,   nil,   757,   334,
    390335   833,   789,   nil,   nil,   nil,   787,   nil,   788,   nil,   789,
    391336   nil,   790,   nil,   791,   792,   nil,   nil,   nil,   nil,   nil,
    392    nil,   814,   nil,     4,   785,   nil,   827,   632,   191,   nil,
    393    nil,   nil,   595,   nil,   848,   nil,   807,   nil,   489,   802,
     337   nil,   814,   nil,     4,   785,   nil,   827,   649,   131,   nil,
     338   nil,   nil,   509,   nil,   848,   nil,   807,   nil,   565,   802,
    394339   850,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   786,
    395340   nil,   nil,   nil,   806,   nil,   nil,   nil,   nil,   823,   854,
    396    855,   847,   814,   nil,   nil,   425,   828,   nil,   nil,   436,
    397    nil,   260,   379,   863,   855,   856,   857,   453,   nil,   797,
    398    798,   632,   nil,   nil,   nil,   nil ]
     341   855,   847,   814,   nil,   nil,   468,   828,   nil,   nil,   548,
     342   nil,   241,   320,   863,   855,   856,   857,   399,   nil,   797,
     343   798,   620,   nil,   nil,   nil,   nil ]
    399344
    400345racc_action_default = [
     
    421366  -134,  -123,  -149,  -146,  -135,  -124,  -115,  -108,  -107,   -87,
    422367   -86,  -376,  -376,  -376,  -287,  -376,  -276,  -376,  -263,  -277,
    423   -274,  -264,  -273,  -265,  -260,  -275,  -261,  -262,  -307,  -376,
     368  -273,  -274,  -264,  -265,  -260,  -275,  -261,  -262,  -307,  -376,
    424369  -253,  -251,  -268,  -269,  -266,  -267,  -278,  -270,  -376,  -376,
    425370  -376,  -376,  -376,  -376,  -376,  -376,  -376,  -376,  -116,  -376,
     
    466411    79,   140,   125,   162,    45,    51,   160,   203,   128,   313,
    467412    45,    55,   110,   413,   473,   121,   195,   317,   107,   103,
    468    520,    63,   111,    64,    65,    61,    19,     3,   407,    94,
    469    113,   119,   106,   172,    65,   173,    58,   529,   118,   273,
    470     32,   130,   132,   613,   216,   201,   219,   220,   606,   222,
     413   173,    63,   111,    65,   172,    19,   520,    61,     3,    94,
     414   113,   119,   106,    65,    64,   407,    58,   529,   118,    32,
     415   273,   132,   613,   130,   216,   201,   219,   220,   221,   606,
    471416    60,   205,   225,   315,   115,   175,   312,   479,   189,   206,
    472417   186,   190,   192,    74,   198,   176,    72,    18,    11,     2,
    473    136,    69,   570,   178,   185,    52,    33,   194,   197,   200,
    474    218,   182,    63,   221,    64,   223,   224,   204,   226,   227,
    475    174,   177,   179,   107,   208,   181,   184,   180,   173,   231,
    476    188,   232,   233,   234,   235,   191,   193,   106,   196,   199,
     418   136,   218,    69,   178,   185,   222,   223,   224,   570,   226,
     419   227,   182,    63,   173,   231,    52,   232,   233,   234,   235,
     420    33,   194,   197,   107,   208,    64,   200,   180,   204,   174,
     421   177,   179,   181,   184,   188,   191,   193,   106,   196,   199,
    477422    27,    45,   210,    22,   163,   138,    14,   406,     6,   214,
    478423   580,   600,     4,   542,   592,   572,   nil,   nil,   nil,   nil,
    479424   256,   nil,   nil,   nil,   nil,   nil,   257,   nil,   nil,   nil,
    480    nil,   nil,   nil,   253,   nil,   nil,   nil,   nil,   nil,   318,
     425   318,   nil,   nil,   253,   nil,   nil,   nil,   nil,   nil,   nil,
    481426   nil,   nil,   nil,   nil,   nil,   304,   nil,   nil,   nil,   252,
    482427   nil,   308,   nil,   nil,   nil,   nil,   251,   nil,   nil,   nil,
     
    524469    18,   104,    80,    34,    23,    15,    22,   103,    81,    24,
    525470    23,    15,    82,   114,    51,    87,    78,    48,    59,    62,
    526     26,    72,    71,    66,    60,    69,    14,     1,    52,    23,
    527     83,    86,    23,   108,    60,    57,    58,    50,    85,    39,
    528     14,    69,    60,    37,   110,    80,   110,   110,    36,   110,
     471    57,    72,    71,    60,   108,    14,    26,    69,     1,    23,
     472    83,    86,    23,    60,    66,    52,    58,    50,    85,    14,
     473    39,    60,    37,    69,   110,    80,   110,   110,   110,    36,
    529474    68,    81,   110,    25,    84,    82,    20,    53,    87,    74,
    530475    75,    76,    77,    17,    79,    71,    16,    13,    12,    11,
    531     10,     9,    26,    83,    86,     8,     7,    89,    90,    91,
    532    108,    85,    72,   108,    66,   108,   108,    92,   108,   108,
    533     93,    94,    95,    59,    62,    96,    97,    84,    57,    57,
    534     98,    57,    57,    57,    57,    99,   100,    23,   101,   102,
     476    10,   108,     9,    83,    86,   108,   108,   108,    26,   108,
     477   108,    85,    72,    57,    57,     8,    57,    57,    57,    57,
     478     7,    89,    90,    59,    62,    66,    91,    84,    92,    93,
     479    94,    95,    96,    97,    98,    99,   100,    23,   101,   102,
    535480     6,    23,    15,     5,   105,   107,     4,    48,     3,   111,
    536481   112,   113,     2,   115,   126,   128,   nil,   nil,   nil,   nil,
    537482    80,   nil,   nil,   nil,   nil,   nil,    81,   nil,   nil,   nil,
    538    nil,   nil,   nil,    87,   nil,   nil,   nil,   nil,   nil,   108,
     483   108,   nil,   nil,    87,   nil,   nil,   nil,   nil,   nil,   nil,
    539484   nil,   nil,   nil,   nil,   nil,    80,   nil,   nil,   nil,    86,
    540485   nil,    81,   nil,   nil,   nil,   nil,    85,   nil,   nil,   nil,
     
    580525
    581526racc_goto_pointer = [
    582    nil,    27,   122,   118,   110,    99,    88,    49,    42,    19,
    583      1,    69,    63,    55,    14,   -23,    13,    10,   -53,   nil,
    584   -159,   nil,   -80,   -24,  -206,  -162,  -457,   nil,   nil,   nil,
    585    nil,   nil,   nil,   nil,   -85,   nil,  -550,  -563,   nil,  -173,
     527   nil,    28,   122,   118,   110,    99,    88,    63,    52,    20,
     528     1,    69,    63,    55,    13,   -23,    13,    10,   -53,   nil,
     529  -159,   nil,   -80,   -24,  -206,  -162,  -451,   nil,   nil,   nil,
     530   nil,   nil,   nil,   nil,   -85,   nil,  -549,  -564,   nil,  -172,
    586531   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,  -198,   nil,
    587   -440,  -386,  -288,  -350,   nil,   nil,   nil,   -66,    -4,   -38,
    588    -24,   nil,   -37,   nil,   nil,   nil,   -22,   nil,     6,   -19,
     532  -440,  -386,  -281,  -350,   nil,   nil,   nil,   -81,    -4,   -38,
     533   -25,   nil,   -37,   nil,   nil,   nil,   -11,   nil,     6,   -17,
    589534   nil,   -37,   -24,   nil,   -47,   -42,   -41,   -40,   -86,   -38,
    590    -57,   -51,   -47,   -29,    -5,   -21,   -28,   -44,   nil,   -25,
    591    -24,   -23,   -15,   -12,   -11,   -10,    -7,    -6,    -2,     3,
    592      4,     6,     7,   -95,   -78,    23,   nil,    39,   -68,   nil,
     535   -57,   -51,   -47,   -29,    -5,   -21,   -28,   -44,   nil,   -11,
     536   -10,    -6,    -4,    -3,    -2,    -1,     0,     1,     2,     3,
     537     4,     6,     7,   -95,   -78,    23,   nil,    39,   -77,   nil,
    593538  -103,   -24,  -421,  -457,  -306,  -359,   nil,   nil,   nil,   nil,
    594539   nil,   nil,   nil,   nil,   nil,   nil,  -443,   nil,  -409 ]
     
    905850  3, 206, :_reduce_293,
    906851  5, 147, :_reduce_294,
    907   1, 207, :_reduce_none,
     852  1, 207, :_reduce_295,
    908853  3, 207, :_reduce_none,
    909854  3, 207, :_reduce_none,
     
    25162461# reduce 167 omitted
    25172462
    2518 module_eval(<<'.,.,', 'parser.y', 822)
     2463module_eval(<<'.,.,', 'parser.y', 820)
    25192464  def _reduce_168(val, _values, result)
    25202465        begin
     
    25292474.,.,
    25302475
    2531 module_eval(<<'.,.,', 'parser.y', 831)
     2476module_eval(<<'.,.,', 'parser.y', 829)
    25322477  def _reduce_169(val, _values, result)
    25332478        begin
     
    25422487.,.,
    25432488
    2544 module_eval(<<'.,.,', 'parser.y', 840)
     2489module_eval(<<'.,.,', 'parser.y', 838)
    25452490  def _reduce_170(val, _values, result)
    25462491        begin
     
    25792524# reduce 182 omitted
    25802525
    2581 module_eval(<<'.,.,', 'parser.y', 865)
     2526module_eval(<<'.,.,', 'parser.y', 863)
    25822527  def _reduce_183(val, _values, result)
    25832528        result = true
     
    25872532.,.,
    25882533
    2589 module_eval(<<'.,.,', 'parser.y', 869)
     2534module_eval(<<'.,.,', 'parser.y', 867)
    25902535  def _reduce_184(val, _values, result)
    25912536        result = false
     
    26092554# reduce 191 omitted
    26102555
    2611 module_eval(<<'.,.,', 'parser.y', 884)
     2556module_eval(<<'.,.,', 'parser.y', 882)
    26122557  def _reduce_192(val, _values, result)
    26132558        result = val[0]
     
    26672612# reduce 217 omitted
    26682613
    2669 module_eval(<<'.,.,', 'parser.y', 919)
     2614module_eval(<<'.,.,', 'parser.y', 917)
    26702615  def _reduce_218(val, _values, result)
    26712616        @@logger.debug("V_ISO8601_EXTENDED_DATE_TIME: #{val[0]} at #{@filename}:#{@lineno}")
     
    27002645# reduce 230 omitted
    27012646
    2702 module_eval(<<'.,.,', 'parser.y', 939)
     2647module_eval(<<'.,.,', 'parser.y', 937)
    27032648  def _reduce_231(val, _values, result)
    27042649        @@logger.debug("V_ISO8601_DURATION: #{val[0]} at #{@filename}:#{@lineno}")
     
    27332678# reduce 243 omitted
    27342679
    2735 module_eval(<<'.,.,', 'parser.y', 959)
     2680module_eval(<<'.,.,', 'parser.y', 957)
    27362681  def _reduce_244(val, _values, result)
    27372682        @@logger.debug("#{__FILE__}:#{__LINE__}: V_QUALIFIED_TERM_CODE_REF = #{val[0]} at #{@filename}:#{@lineno}")
     
    27482693# reduce 247 omitted
    27492694
    2750 module_eval(<<'.,.,', 'parser.y', 969)
     2695module_eval(<<'.,.,', 'parser.y', 967)
    27512696  def _reduce_248(val, _values, result)
    27522697        @@logger.debug("#{__FILE__}:#{__LINE__}: V_URI = #{val[0]} at #{@filename}:#{@lineno}")
     
    27732718# reduce 256 omitted
    27742719
    2775 module_eval(<<'.,.,', 'parser.y', 992)
     2720module_eval(<<'.,.,', 'parser.y', 990)
    27762721  def _reduce_257(val, _values, result)
    27772722        @@logger.debug("#{__FILE__}:#{__LINE__}, boolean_node:  relative_path = #{val[0]}, regexp_body => #{val[3]} at #{@filename}")
     
    28382783# reduce 285 omitted
    28392784
    2840 module_eval(<<'.,.,', 'parser.y', 1039)
     2785module_eval(<<'.,.,', 'parser.y', 1037)
    28412786  def _reduce_286(val, _values, result)
    28422787        @@logger.debug("#{__FILE__}:#{__LINE__}, relative_path = #{val[0]}")
     
    28472792.,.,
    28482793
    2849 module_eval(<<'.,.,', 'parser.y', 1044)
     2794module_eval(<<'.,.,', 'parser.y', 1042)
    28502795  def _reduce_287(val, _values, result)
    28512796        @@logger.debug("#{__FILE__}:#{__LINE__}, relative_path = #{val[0]}/#{val[2]}")
     
    28562801.,.,
    28572802
    2858 module_eval(<<'.,.,', 'parser.y', 1050)
     2803module_eval(<<'.,.,', 'parser.y', 1048)
    28592804  def _reduce_288(val, _values, result)
    28602805        @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}")
     
    28652810.,.,
    28662811
    2867 module_eval(<<'.,.,', 'parser.y', 1055)
     2812module_eval(<<'.,.,', 'parser.y', 1053)
    28682813  def _reduce_289(val, _values, result)
    28692814        @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}")
     
    28742819.,.,
    28752820
    2876 module_eval(<<'.,.,', 'parser.y', 1067)
     2821module_eval(<<'.,.,', 'parser.y', 1065)
    28772822  def _reduce_290(val, _values, result)
    28782823        result = Range.new(1,1)
     
    28822827.,.,
    28832828
    2884 module_eval(<<'.,.,', 'parser.y', 1071)
     2829module_eval(<<'.,.,', 'parser.y', 1069)
    28852830  def _reduce_291(val, _values, result)
    28862831        result = val[3]
     
    28902835.,.,
    28912836
    2892 module_eval(<<'.,.,', 'parser.y', 1076)
     2837module_eval(<<'.,.,', 'parser.y', 1074)
    28932838  def _reduce_292(val, _values, result)
    28942839        begin
     
    29032848.,.,
    29042849
    2905 module_eval(<<'.,.,', 'parser.y', 1085)
     2850module_eval(<<'.,.,', 'parser.y', 1083)
    29062851  def _reduce_293(val, _values, result)
    29072852        begin
     
    29172862.,.,
    29182863
    2919 module_eval(<<'.,.,', 'parser.y', 1096)
     2864module_eval(<<'.,.,', 'parser.y', 1094)
    29202865  def _reduce_294(val, _values, result)
    29212866        result = OpenEhr::AM::Archetype::ConstraintModel::CARDINALITY.new
     
    29252870.,.,
    29262871
    2927 # reduce 295 omitted
     2872module_eval(<<'.,.,', 'parser.y', 1099)
     2873  def _reduce_295(val, _values, result)
     2874        result = val[0]
     2875 
     2876    result
     2877  end
     2878.,.,
    29282879
    29292880# reduce 296 omitted
     
    29412892# reduce 302 omitted
    29422893
    2943 module_eval(<<'.,.,', 'parser.y', 1110)
     2894module_eval(<<'.,.,', 'parser.y', 1111)
    29442895  def _reduce_303(val, _values, result)
    29452896        result = val[0]
     
    29492900.,.,
    29502901
    2951 module_eval(<<'.,.,', 'parser.y', 1114)
     2902module_eval(<<'.,.,', 'parser.y', 1115)
    29522903  def _reduce_304(val, _values, result)
    29532904        result = val[0]
     
    29592910# reduce 305 omitted
    29602911
    2961 module_eval(<<'.,.,', 'parser.y', 1121)
     2912module_eval(<<'.,.,', 'parser.y', 1122)
    29622913  def _reduce_306(val, _values, result)
    29632914        case val[3]
     
    29742925# reduce 307 omitted
    29752926
    2976 module_eval(<<'.,.,', 'parser.y', 1132)
     2927module_eval(<<'.,.,', 'parser.y', 1133)
    29772928  def _reduce_308(val, _values, result)
    29782929        result = val[0]
     
    29822933.,.,
    29832934
    2984 module_eval(<<'.,.,', 'parser.y', 1136)
     2935module_eval(<<'.,.,', 'parser.y', 1137)
    29852936  def _reduce_309(val, _values, result)
    29862937        result = OpenEhr::RM::Support::AssumedTypes::Interval.new(val[0], val[2])
     
    30763027# reduce 352 omitted
    30773028
    3078 module_eval(<<'.,.,', 'parser.y', 1202)
     3029module_eval(<<'.,.,', 'parser.y', 1203)
    30793030  def _reduce_353(val, _values, result)
    30803031        result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN.new(:true_valid => true)
     
    30843035.,.,
    30853036
    3086 module_eval(<<'.,.,', 'parser.y', 1206)
     3037module_eval(<<'.,.,', 'parser.y', 1207)
    30873038  def _reduce_354(val, _values, result)
    30883039        result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN.new(:true_valid => false)
     
    30923043.,.,
    30933044
    3094 module_eval(<<'.,.,', 'parser.y', 1210)
     3045module_eval(<<'.,.,', 'parser.y', 1211)
    30953046  def _reduce_355(val, _values, result)
    30963047        result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN.new(:true_valid => true,:false_valid => false)
     
    31003051.,.,
    31013052
    3102 module_eval(<<'.,.,', 'parser.y', 1214)
     3053module_eval(<<'.,.,', 'parser.y', 1215)
    31033054  def _reduce_356(val, _values, result)
    31043055        result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_BOOLEAN.new(:true_valid => false,:false_valid => true)
     
    31083059.,.,
    31093060
    3110 module_eval(<<'.,.,', 'parser.y', 1219)
     3061module_eval(<<'.,.,', 'parser.y', 1220)
    31113062  def _reduce_357(val, _values, result)
    31123063        result = val[0]
     
    31163067.,.,
    31173068
    3118 module_eval(<<'.,.,', 'parser.y', 1223)
     3069module_eval(<<'.,.,', 'parser.y', 1224)
    31193070  def _reduce_358(val, _values, result)
    31203071        result = val[0]
     
    31253076.,.,
    31263077
    3127 module_eval(<<'.,.,', 'parser.y', 1228)
     3078module_eval(<<'.,.,', 'parser.y', 1229)
    31283079  def _reduce_359(val, _values, result)
    31293080        raise 'Not implemented yet'
     
    31433094# reduce 364 omitted
    31443095
    3145 module_eval(<<'.,.,', 'parser.y', 1240)
     3096module_eval(<<'.,.,', 'parser.y', 1241)
    31463097  def _reduce_365(val, _values, result)
    31473098        @in_interval = false
     
    31523103.,.,
    31533104
    3154 module_eval(<<'.,.,', 'parser.y', 1247)
     3105module_eval(<<'.,.,', 'parser.y', 1248)
    31553106  def _reduce_366(val, _values, result)
    31563107          result = val[0]
     
    31603111.,.,
    31613112
    3162 module_eval(<<'.,.,', 'parser.y', 1251)
     3113module_eval(<<'.,.,', 'parser.y', 1252)
    31633114  def _reduce_367(val, _values, result)
    31643115          result = val[0]
     
    31683119.,.,
    31693120
    3170 module_eval(<<'.,.,', 'parser.y', 1257)
     3121module_eval(<<'.,.,', 'parser.y', 1258)
    31713122  def _reduce_368(val, _values, result)
    31723123        @@logger.debug("#{__FILE__}:#{__LINE__}, START_TERM_CODE_CONSTRAINT = #{val[0]} at #{@filename}")
     
    31853136# reduce 371 omitted
    31863137
    3187 module_eval(<<'.,.,', 'parser.y', 1273)
     3138module_eval(<<'.,.,', 'parser.y', 1274)
    31883139  def _reduce_372(val, _values, result)
    31893140          result = val[0]
     
    31933144.,.,
    31943145
    3195 module_eval(<<'.,.,', 'parser.y', 1278)
     3146module_eval(<<'.,.,', 'parser.y', 1279)
    31963147  def _reduce_373(val, _values, result)
    31973148          result = val[0]
     
    32013152.,.,
    32023153
    3203 module_eval(<<'.,.,', 'parser.y', 1282)
     3154module_eval(<<'.,.,', 'parser.y', 1283)
    32043155  def _reduce_374(val, _values, result)
    32053156        @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}")
     
    32103161.,.,
    32113162
    3212 module_eval(<<'.,.,', 'parser.y', 1293)
     3163module_eval(<<'.,.,', 'parser.y', 1294)
    32133164  def _reduce_375(val, _values, result)
    32143165        result = OpenEhr::AM::Archetype::ConstraintModel::Primitive::C_DURATION.new #val[0]
  • ruby/trunk/lib/adl_parser/lib/parser.y

    r321 r323  
    802802    result = - integer
    803803  }
    804 ###   | '+' V_INTEGER
    805 ###   | '-' V_INTEGER
    806804
    807805integer_list_value: integer_value Comma_code integer_value
     
    10121010  | SYM_FALSE
    10131011
    1014 arithmetic_node: arithmetic_expression '+' arithmetic_leaf
     1012arithmetic_node: arithmetic_expression Plus_code arithmetic_leaf
    10151013  | arithmetic_expression Minus_code arithmetic_leaf
    10161014  | arithmetic_expression Star_code arithmetic_leaf
     
    10991097
    11001098cardinality_spec: occurrence_spec
     1099  {
     1100    result = val[0]
     1101  }
    11011102  | occurrence_spec Semicolon_code SYM_ORDERED
    11021103  | occurrence_spec Semicolon_code SYM_UNORDERED
     
    13301331end
    13311332
    1332 
    1333 ###----------/* keywords */ ---------------------------------------------
    1334 ### @@adl_reserved = {
    1335 ###     'archetype' => :SYM_ARCHETYPE,
    1336 ###     'adl_version' => :SYM_ADL_VERSION,
    1337 ###     'controlled' => :SYM_IS_CONTROLLED,
    1338 ###     'specialize' => :SYM_SPECIALIZE,
    1339 ###     'concept' => :SYM_CONCEPT,
    1340 ###     'language' => :SYM_LANGUAGE,
    1341 ###     'description' => :SYM_DESCRIPTION,
    1342 ###     'definition' => :SYM_DEFINITION,
    1343 ###     'invariant' => :SYM_INVARIANT,
    1344 ###     'ontology' => :SYM_ONTOLOGY,
    1345 ###     'matches' => :SYM_MATCHES,
    1346 ###     'is_in' => :SYM_MATCHES,
    1347 ###     'occurrences' => :SYM_OCCURRENCES,
    1348 ###     'true' => :SYM_TRUE, #[Tt][Rr][Uu][Ee] -- -> SYM_TRUE
    1349 ###     'false' => :SYM_FALSE, # [Ff][Aa][Ll][Ss][Ee] -- -> SYM_FALSE
    1350 ###     'infinity' => :SYM_INFINITY # [Ii][Nn][Ff][Ii][Nn][Ii][Tt][Yy] -- -> SYM_INFINITY
    1351 ### }
    1352 
    1353 ### @@dadl_reserved = {
    1354 ###   'true' => :SYM_TRUE, #[Tt][Rr][Uu][Ee] -- -> SYM_TRUE
    1355 ###   'false' => :SYM_FALSE, # [Ff][Aa][Ll][Ss][Ee] -- -> SYM_FALSE
    1356 ###   'infinity' => :SYM_INFINITY # [Ii][Nn][Ff][Ii][Nn][Ii][Tt][Yy] -- -> SYM_INFINITY
    1357 ### }
    1358 
    1359 ### @@cadl_reserved = {
    1360 ###   'then' => :SYM_THEN, # [Tt][Hh][Ee][Nn]
    1361 ###   'else' => :SYM_ELSE, # [Ee][Ll][Ss][Ee]
    1362 ###   'and' => :SYM_AND, # [Aa][Nn][Dd]
    1363 ###   'or' => :SYM_OR, # [Oo][Rr]
    1364 ###   'xor' => :SYM_XOR, # [Xx][Oo][Rr]
    1365 ###   'not' => :SYM_NOT, # [Nn][Oo][Tt]
    1366 ###   'implies' => :SYM_IMPLIES, # [Ii][Mm][Pp][Ll][Ii][Ee][Ss]
    1367 ###   'true' => :SYM_TRUE, #[Tt][Rr][Uu][Ee] -- -> SYM_TRUE
    1368 ###   'false' => :SYM_FALSE, # [Ff][Aa][Ll][Ss][Ee] -- -> SYM_FALSE
    1369 ###   'forall' => :SYM_FORALL, # [Ff][Oo][Rr][_][Aa][Ll][Ll]
    1370 ###   'exists' => :SYM_EXISTS, # [Ee][Xx][Ii][Ss][Tt][Ss]
    1371 ###   'existence' => :SYM_EXISTENCE, # [Ee][Xx][Iu][Ss][Tt][Ee][Nn][Cc][Ee]
    1372 ###   'occurrences' => :SYM_OCCURRENCES, # [Oo][Cc][Cc][Uu][Rr][Rr][Ee][Nn][Cc][Ee][Ss]
    1373 ###   'cardinality' => :SYM_CARDINALITY, # [Cc][Aa][Rr][Dd][Ii][Nn][Aa][Ll][Ii][Tt][Yy]
    1374 ###   'ordered' => :SYM_ORDERED, # [Oo][Rr][Dd][Ee][Rr][Ee][Dd]
    1375 ###   'unordered' => :SYM_UNORDERED, # [Uu][Nn][Oo][Rr][Dd][Ee][Rr][Ee][Dd]
    1376 ###   'unique' => :SYM_UNIQUE, # [Uu][Nn][Ii][Qq][Uu][Ee]
    1377 ###   'matches' => :SYM_MATCHES, # [Mm][Aa][Tt][Cc][Hh][Ee][Ss]
    1378 ###   'is_in' => :SYM_MATCHES, # [Ii][Ss][_][Ii][Nn]
    1379 ###   'invariant' => :SYM_INVARIANT, # [Ii][Nn][Vv][Aa][Rr][Ii][Aa][Nn][Tt]
    1380 ###   'infinity' => :SYM_INFINITY, # [Ii][Nn][Ff][Ii][Nn][Ii][Tt][Yy] -- -> SYM_INFINITY
    1381 ###   'use_node' => :SYM_USE_NODE, # [Uu][Ss][Ee][_][Nn][Oo][Dd][Ee]
    1382 ###   'use_archetype' => :SYM_ALLOW_ARCHETYPE, # [Uu][Ss][Ee][_][Aa][Rr][Cc][Hh][Ee][Tt][Yy][Pp][Ee]
    1383 ###   'allow_archetype' => :SYM_ALLOW_ARCHETYPE, # [Aa][Ll][Ll][Oo][Ww][_][Aa][Rr][Cc][Hh][Ee][Tt][Yy][Pp][Ee]
    1384 ###   'include' => :SYM_INCLUDE, # [Ii][Nn][Cc][Ll][Uu][Dd][Ee]
    1385 ###   'exclude' => :SYM_EXCLUDE # [Ee][Xx][Cc][Ll][Uu][Dd][Ee]
    1386 ### }
    13871333
    13881334
  • ruby/trunk/lib/adl_parser/test/parser_test.rb

    r321 r323  
    258258  end
    259259
     260  must "adl-test-ENTRY.assumed_types.v1.adl be properly parsed" do
     261    file =  File.read("#{TEST_ROOT_DIR}/adl/adl-test-ENTRY.assumed_types.v1.adl")
     262    assert_nothing_raised do
     263      ast = @parser.parse(file, 'adl-test-ENTRY.assumed_types.v1')
     264      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
     265    end
     266  end
     267
    260268  must "adl-test-ENTRY.basic_types.v1.adl be properly parsed" do
    261269    file =  File.read("#{TEST_ROOT_DIR}/adl/adl-test-ENTRY.basic_types.v1.adl")
     
    267275
    268276
    269   must "adl-test-ENTRY.assumed_types.v1.adl be properly parsed" do
    270     file =  File.read("#{TEST_ROOT_DIR}/adl/adl-test-ENTRY.assumed_types.v1.adl")
    271     assert_nothing_raised do
    272       ast = @parser.parse(file, 'adl-test-ENTRY.assumed_types.v1')
     277  must "adl-test-ENTRY.basic_types_fail.v1.adl be properly parsed" do
     278    file =  File.read("#{TEST_ROOT_DIR}/adl/adl-test-ENTRY.basic_types_fail.v1.adl")
     279    assert_raise Racc::ParseError do
     280      ast = @parser.parse(file, 'adl-test-ENTRY.basic_types_fail.v1')
     281      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
     282    end
     283  end
     284
     285  must "adl-test-ENTRY.most_minimal.v1.adl be properly parsed" do
     286    file =  File.read("#{TEST_ROOT_DIR}/adl/adl-test-ENTRY.most_minimal.v1.adl")
     287    assert_nothing_raised do
     288      ast = @parser.parse(file, 'adl-test-ENTRY.most_minimal.v1')
     289      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
     290    end
     291  end
     292
     293  must "adl-test-ENTRY.structure_test1.v1.adl be properly parsed" do
     294    file =  File.read("#{TEST_ROOT_DIR}/adl/adl-test-ENTRY.structure_test1.v1.adl")
     295    assert_nothing_raised do
     296      ast = @parser.parse(file, 'adl-test-ENTRY.structure_test1.v1')
    273297      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    274298    end
  • ruby/trunk/lib/adl_parser/test/remote_adl_test.rb

    r319 r323  
    2828
    2929
    30   must "test_adls should properly parsed" do
     30#   must "test_adls should properly parsed" do
     31#     assert_nothing_raised do
     32#       @test_adls.each do |adl|
     33#         puts "Processing #{adl}"
     34#         open(adl) do |file|
     35#           p "Processing #{file.gets}"
     36#           case file.gets
     37#           when "http://www.openehr.org/svn/knowledge/archetypes/dev/adl/test/basics/adl-test-ENTRY.basic_types_fail.v1.adl"
     38#             assert_raise Racc::ParserError do
     39#               @parser.parse(file.read, adl)
     40#             end
     41#           else
     42#             assert_nothing_raised { @parser.parse(file.read, adl) }
     43#           end
     44#         end
     45#       end
     46#     end
     47#   end
     48
     49  must "ehr_adls should properly parsed" do
    3150    assert_nothing_raised do
    32       @test_adls.each do |adl|
     51      @ehr_adls.each do |adl|
    3352        puts "Processing #{adl}"
    3453        open(adl) do |file|
    35           @parser.parse(file.read, adl)
     54          assert_nothing_raised do
     55            @parser.parse(file.read, adl)
     56          end
    3657        end
    3758      end
     
    3960  end
    4061
    41 #   must "ehr_adls should properly parsed" do
    42 #     assert_nothing_raised do
    43 #       @ehr_adls.each do |adl|
    44 #         puts "Processing #{adl}"
    45 #         open(adl) do |file|
    46 #           @parser.parse(file.read, adl)
    47 #         end
    48 #       end
    49 #     end
    50 #   end
    51 
    5262
    5363end
Note: See TracChangeset for help on using the changeset viewer.