expressir 0.2.4-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (520) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/rake.yml +46 -0
  3. data/.github/workflows/release.yml +75 -0
  4. data/.gitignore +15 -0
  5. data/.gitmodules +3 -0
  6. data/.rspec +2 -0
  7. data/.rubocop.yml +508 -0
  8. data/Gemfile +6 -0
  9. data/README.adoc +147 -0
  10. data/Rakefile +17 -0
  11. data/bin/console +12 -0
  12. data/bin/rspec +29 -0
  13. data/bin/setup +8 -0
  14. data/demo.rb +18 -0
  15. data/docs/development.md +90 -0
  16. data/exe/expressir +20 -0
  17. data/exe/generate-parser +48 -0
  18. data/expressir.gemspec +40 -0
  19. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/CMakeLists.txt +118 -0
  20. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2013.vcxproj +637 -0
  21. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2013.vcxproj.filters +984 -0
  22. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2015.vcxproj +652 -0
  23. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2015.vcxproj.filters +990 -0
  24. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2017.vcxproj +652 -0
  25. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2017.vcxproj.filters +990 -0
  26. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2019.vcxproj +652 -0
  27. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2019.vcxproj.filters +990 -0
  28. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp-ios/Info.plist +26 -0
  29. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp-ios/antlrcpp_ios.h +17 -0
  30. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.pbxproj +3024 -0
  31. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  32. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  33. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/xcshareddata/xcschemes/antlr4.xcscheme +76 -0
  34. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/xcshareddata/xcschemes/antlr4_ios.xcscheme +80 -0
  35. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/xcshareddata/xcschemes/antlr4_static.xcscheme +80 -0
  36. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorListener.cpp +10 -0
  37. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorListener.h +167 -0
  38. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorStrategy.cpp +10 -0
  39. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorStrategy.h +121 -0
  40. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRFileStream.cpp +34 -0
  41. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRFileStream.h +27 -0
  42. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRInputStream.cpp +155 -0
  43. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRInputStream.h +69 -0
  44. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/BailErrorStrategy.cpp +61 -0
  45. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/BailErrorStrategy.h +59 -0
  46. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/BaseErrorListener.cpp +25 -0
  47. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/BaseErrorListener.h +36 -0
  48. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/BufferedTokenStream.cpp +414 -0
  49. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/BufferedTokenStream.h +200 -0
  50. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CharStream.cpp +11 -0
  51. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CharStream.h +37 -0
  52. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonToken.cpp +195 -0
  53. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonToken.h +158 -0
  54. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenFactory.cpp +39 -0
  55. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenFactory.h +74 -0
  56. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenStream.cpp +78 -0
  57. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenStream.h +79 -0
  58. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ConsoleErrorListener.cpp +15 -0
  59. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ConsoleErrorListener.h +35 -0
  60. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/DefaultErrorStrategy.cpp +333 -0
  61. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/DefaultErrorStrategy.h +466 -0
  62. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/DiagnosticErrorListener.cpp +84 -0
  63. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/DiagnosticErrorListener.h +80 -0
  64. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Exceptions.cpp +64 -0
  65. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Exceptions.h +99 -0
  66. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/FailedPredicateException.cpp +51 -0
  67. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/FailedPredicateException.h +32 -0
  68. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/InputMismatchException.cpp +18 -0
  69. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/InputMismatchException.h +24 -0
  70. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/IntStream.cpp +12 -0
  71. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/IntStream.h +218 -0
  72. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/InterpreterRuleContext.cpp +19 -0
  73. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/InterpreterRuleContext.h +45 -0
  74. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Lexer.cpp +295 -0
  75. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Lexer.h +196 -0
  76. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerInterpreter.cpp +75 -0
  77. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerInterpreter.h +52 -0
  78. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerNoViableAltException.cpp +36 -0
  79. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerNoViableAltException.h +31 -0
  80. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ListTokenSource.cpp +92 -0
  81. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ListTokenSource.h +88 -0
  82. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/NoViableAltException.cpp +46 -0
  83. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/NoViableAltException.h +42 -0
  84. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Parser.cpp +648 -0
  85. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Parser.h +467 -0
  86. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserInterpreter.cpp +306 -0
  87. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserInterpreter.h +179 -0
  88. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserRuleContext.cpp +141 -0
  89. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserRuleContext.h +147 -0
  90. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ProxyErrorListener.cpp +53 -0
  91. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ProxyErrorListener.h +38 -0
  92. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RecognitionException.cpp +66 -0
  93. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RecognitionException.h +98 -0
  94. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Recognizer.cpp +167 -0
  95. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Recognizer.h +164 -0
  96. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContext.cpp +143 -0
  97. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContext.h +137 -0
  98. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContextWithAltNum.cpp +27 -0
  99. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContextWithAltNum.h +32 -0
  100. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RuntimeMetaData.cpp +53 -0
  101. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RuntimeMetaData.h +155 -0
  102. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Token.cpp +9 -0
  103. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Token.h +92 -0
  104. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenFactory.h +30 -0
  105. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenSource.cpp +9 -0
  106. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenSource.h +85 -0
  107. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStream.cpp +11 -0
  108. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStream.h +137 -0
  109. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStreamRewriter.cpp +425 -0
  110. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStreamRewriter.h +293 -0
  111. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedCharStream.cpp +211 -0
  112. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedCharStream.h +123 -0
  113. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedTokenStream.cpp +270 -0
  114. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedTokenStream.h +115 -0
  115. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Vocabulary.cpp +104 -0
  116. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Vocabulary.h +193 -0
  117. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/WritableToken.cpp +9 -0
  118. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/WritableToken.h +23 -0
  119. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/antlr4-common.h +137 -0
  120. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/antlr4-runtime.h +167 -0
  121. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATN.cpp +209 -0
  122. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATN.h +112 -0
  123. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfig.cpp +113 -0
  124. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfig.h +148 -0
  125. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfigSet.cpp +228 -0
  126. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfigSet.h +110 -0
  127. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.cpp +64 -0
  128. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.h +50 -0
  129. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializer.cpp +758 -0
  130. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializer.h +85 -0
  131. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSerializer.cpp +621 -0
  132. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSerializer.h +61 -0
  133. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSimulator.cpp +63 -0
  134. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSimulator.h +87 -0
  135. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNState.cpp +72 -0
  136. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNState.h +133 -0
  137. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNType.h +20 -0
  138. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AbstractPredicateTransition.cpp +14 -0
  139. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AbstractPredicateTransition.h +24 -0
  140. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ActionTransition.cpp +33 -0
  141. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ActionTransition.h +33 -0
  142. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AmbiguityInfo.cpp +16 -0
  143. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AmbiguityInfo.h +68 -0
  144. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.cpp +82 -0
  145. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.h +43 -0
  146. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AtomTransition.cpp +31 -0
  147. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AtomTransition.h +30 -0
  148. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicBlockStartState.cpp +12 -0
  149. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicBlockStartState.h +22 -0
  150. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicState.cpp +12 -0
  151. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicState.h +21 -0
  152. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockEndState.cpp +15 -0
  153. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockEndState.h +24 -0
  154. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockStartState.cpp +9 -0
  155. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockStartState.h +21 -0
  156. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ContextSensitivityInfo.cpp +14 -0
  157. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ContextSensitivityInfo.h +47 -0
  158. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionEventInfo.cpp +14 -0
  159. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionEventInfo.h +70 -0
  160. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionInfo.cpp +25 -0
  161. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionInfo.h +227 -0
  162. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionState.cpp +17 -0
  163. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionState.h +30 -0
  164. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EmptyPredictionContext.cpp +35 -0
  165. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EmptyPredictionContext.h +27 -0
  166. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EpsilonTransition.cpp +35 -0
  167. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EpsilonTransition.h +39 -0
  168. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ErrorInfo.cpp +15 -0
  169. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ErrorInfo.h +43 -0
  170. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LL1Analyzer.cpp +158 -0
  171. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LL1Analyzer.h +109 -0
  172. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNConfig.cpp +84 -0
  173. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNConfig.h +44 -0
  174. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNSimulator.cpp +628 -0
  175. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNSimulator.h +210 -0
  176. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerAction.cpp +9 -0
  177. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerAction.h +66 -0
  178. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerActionExecutor.cpp +107 -0
  179. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerActionExecutor.h +115 -0
  180. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerActionType.h +55 -0
  181. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerChannelAction.cpp +55 -0
  182. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerChannelAction.h +63 -0
  183. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerCustomAction.cpp +62 -0
  184. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerCustomAction.h +87 -0
  185. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.cpp +63 -0
  186. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.h +82 -0
  187. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerModeAction.cpp +56 -0
  188. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerModeAction.h +61 -0
  189. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerMoreAction.cpp +47 -0
  190. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerMoreAction.h +57 -0
  191. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPopModeAction.cpp +47 -0
  192. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPopModeAction.h +57 -0
  193. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPushModeAction.cpp +56 -0
  194. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPushModeAction.h +61 -0
  195. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerSkipAction.cpp +47 -0
  196. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerSkipAction.h +55 -0
  197. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerTypeAction.cpp +56 -0
  198. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerTypeAction.h +55 -0
  199. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LookaheadEventInfo.cpp +16 -0
  200. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LookaheadEventInfo.h +42 -0
  201. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LoopEndState.cpp +12 -0
  202. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LoopEndState.h +22 -0
  203. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/Makefile +67 -0
  204. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/NotSetTransition.cpp +27 -0
  205. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/NotSetTransition.h +25 -0
  206. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.cpp +12 -0
  207. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.h +20 -0
  208. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParseInfo.cpp +102 -0
  209. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParseInfo.h +102 -0
  210. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp +1366 -0
  211. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParserATNSimulator.h +904 -0
  212. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusBlockStartState.cpp +12 -0
  213. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusBlockStartState.h +25 -0
  214. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusLoopbackState.cpp +12 -0
  215. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusLoopbackState.h +22 -0
  216. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.cpp +32 -0
  217. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.h +29 -0
  218. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.cpp +17 -0
  219. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.h +62 -0
  220. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateTransition.cpp +34 -0
  221. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateTransition.h +39 -0
  222. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContext.cpp +662 -0
  223. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContext.h +254 -0
  224. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionMode.cpp +201 -0
  225. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionMode.h +436 -0
  226. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.cpp +179 -0
  227. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.h +60 -0
  228. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RangeTransition.cpp +30 -0
  229. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RangeTransition.h +29 -0
  230. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStartState.cpp +16 -0
  231. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStartState.h +25 -0
  232. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStopState.cpp +12 -0
  233. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStopState.h +25 -0
  234. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleTransition.cpp +37 -0
  235. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleTransition.h +40 -0
  236. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SemanticContext.cpp +377 -0
  237. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SemanticContext.h +222 -0
  238. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SetTransition.cpp +32 -0
  239. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SetTransition.h +30 -0
  240. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.cpp +81 -0
  241. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.h +36 -0
  242. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarBlockStartState.cpp +12 -0
  243. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarBlockStartState.h +21 -0
  244. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopEntryState.cpp +15 -0
  245. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopEntryState.h +35 -0
  246. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopbackState.cpp +19 -0
  247. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopbackState.h +21 -0
  248. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/TokensStartState.cpp +12 -0
  249. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/TokensStartState.h +21 -0
  250. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/Transition.cpp +44 -0
  251. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/Transition.h +76 -0
  252. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/WildcardTransition.cpp +25 -0
  253. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/WildcardTransition.h +25 -0
  254. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFA.cpp +127 -0
  255. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFA.h +91 -0
  256. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFASerializer.cpp +67 -0
  257. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFASerializer.h +32 -0
  258. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFAState.cpp +100 -0
  259. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFAState.h +144 -0
  260. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.cpp +20 -0
  261. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.h +23 -0
  262. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/InterpreterDataReader.cpp +124 -0
  263. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/InterpreterDataReader.h +31 -0
  264. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Interval.cpp +89 -0
  265. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Interval.h +84 -0
  266. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/IntervalSet.cpp +521 -0
  267. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/IntervalSet.h +198 -0
  268. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/MurmurHash.cpp +134 -0
  269. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/MurmurHash.h +76 -0
  270. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Predicate.cpp +4 -0
  271. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Predicate.h +21 -0
  272. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Any.cpp +13 -0
  273. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Any.h +170 -0
  274. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Arrays.cpp +43 -0
  275. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Arrays.h +110 -0
  276. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/BitSet.h +76 -0
  277. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/CPPUtils.cpp +248 -0
  278. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/CPPUtils.h +78 -0
  279. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Declarations.h +163 -0
  280. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/StringUtils.cpp +36 -0
  281. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/StringUtils.h +54 -0
  282. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/guid.cpp +303 -0
  283. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/guid.h +112 -0
  284. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/AbstractParseTreeVisitor.h +128 -0
  285. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNode.cpp +9 -0
  286. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNode.h +19 -0
  287. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.cpp +23 -0
  288. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.h +33 -0
  289. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.cpp +71 -0
  290. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.h +53 -0
  291. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTree.cpp +15 -0
  292. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTree.h +102 -0
  293. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeListener.cpp +9 -0
  294. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeListener.h +39 -0
  295. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeProperty.h +50 -0
  296. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeVisitor.cpp +9 -0
  297. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeVisitor.h +57 -0
  298. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeWalker.cpp +49 -0
  299. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeWalker.h +31 -0
  300. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNode.cpp +9 -0
  301. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNode.h +32 -0
  302. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.cpp +57 -0
  303. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.h +33 -0
  304. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/Trees.cpp +241 -0
  305. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/Trees.h +78 -0
  306. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/Chunk.cpp +9 -0
  307. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/Chunk.h +44 -0
  308. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreeMatch.cpp +69 -0
  309. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreeMatch.h +132 -0
  310. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePattern.cpp +64 -0
  311. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePattern.h +105 -0
  312. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePatternMatcher.cpp +371 -0
  313. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePatternMatcher.h +185 -0
  314. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.cpp +77 -0
  315. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.h +117 -0
  316. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TagChunk.cpp +39 -0
  317. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TagChunk.h +86 -0
  318. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TextChunk.cpp +28 -0
  319. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TextChunk.h +51 -0
  320. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.cpp +36 -0
  321. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.h +80 -0
  322. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPath.cpp +154 -0
  323. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPath.h +86 -0
  324. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathElement.cpp +31 -0
  325. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathElement.h +40 -0
  326. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp +173 -0
  327. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.g4 +64 -0
  328. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.h +56 -0
  329. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.tokens +12 -0
  330. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexerErrorListener.cpp +13 -0
  331. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexerErrorListener.h +22 -0
  332. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleAnywhereElement.cpp +20 -0
  333. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleAnywhereElement.h +27 -0
  334. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleElement.cpp +30 -0
  335. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleElement.h +26 -0
  336. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenAnywhereElement.cpp +20 -0
  337. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenAnywhereElement.h +25 -0
  338. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenElement.cpp +33 -0
  339. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenElement.h +26 -0
  340. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardAnywhereElement.cpp +23 -0
  341. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardAnywhereElement.h +23 -0
  342. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardElement.cpp +24 -0
  343. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardElement.h +23 -0
  344. data/ext/express-parser/antlrgen/Express.interp +532 -0
  345. data/ext/express-parser/antlrgen/Express.tokens +190 -0
  346. data/ext/express-parser/antlrgen/ExpressBaseListener.cpp +7 -0
  347. data/ext/express-parser/antlrgen/ExpressBaseListener.h +623 -0
  348. data/ext/express-parser/antlrgen/ExpressBaseVisitor.cpp +7 -0
  349. data/ext/express-parser/antlrgen/ExpressBaseVisitor.h +816 -0
  350. data/ext/express-parser/antlrgen/ExpressLexer.cpp +1169 -0
  351. data/ext/express-parser/antlrgen/ExpressLexer.h +85 -0
  352. data/ext/express-parser/antlrgen/ExpressLexer.interp +534 -0
  353. data/ext/express-parser/antlrgen/ExpressLexer.tokens +190 -0
  354. data/ext/express-parser/antlrgen/ExpressListener.cpp +7 -0
  355. data/ext/express-parser/antlrgen/ExpressListener.h +616 -0
  356. data/ext/express-parser/antlrgen/ExpressParser.cpp +17284 -0
  357. data/ext/express-parser/antlrgen/ExpressParser.h +3696 -0
  358. data/ext/express-parser/antlrgen/ExpressVisitor.cpp +7 -0
  359. data/ext/express-parser/antlrgen/ExpressVisitor.h +422 -0
  360. data/ext/express-parser/express_parser.cpp +17931 -0
  361. data/ext/express-parser/extconf.rb +34 -0
  362. data/lib/express_parser.so +0 -0
  363. data/lib/expressir.rb +21 -0
  364. data/lib/expressir/cli.rb +27 -0
  365. data/lib/expressir/cli/ui.rb +36 -0
  366. data/lib/expressir/config.rb +23 -0
  367. data/lib/expressir/express.rb +11 -0
  368. data/lib/expressir/express/aggregate_dimension.rb +38 -0
  369. data/lib/expressir/express/attribute.rb +15 -0
  370. data/lib/expressir/express/comment.rb +7 -0
  371. data/lib/expressir/express/defined_type.rb +36 -0
  372. data/lib/expressir/express/derived.rb +65 -0
  373. data/lib/expressir/express/derived_aggregate.rb +43 -0
  374. data/lib/expressir/express/entity.rb +137 -0
  375. data/lib/expressir/express/explicit.rb +70 -0
  376. data/lib/expressir/express/explicit_aggregate.rb +46 -0
  377. data/lib/expressir/express/explicit_or_derived.rb +16 -0
  378. data/lib/expressir/express/global_rule.rb +44 -0
  379. data/lib/expressir/express/interface_specification.rb +51 -0
  380. data/lib/expressir/express/interfaced_item.rb +38 -0
  381. data/lib/expressir/express/inverse.rb +46 -0
  382. data/lib/expressir/express/inverse_aggregate.rb +37 -0
  383. data/lib/expressir/express/model_element.rb +7 -0
  384. data/lib/expressir/express/named_type.rb +19 -0
  385. data/lib/expressir/express/remark.rb +8 -0
  386. data/lib/expressir/express/repository.rb +306 -0
  387. data/lib/expressir/express/schema_definition.rb +96 -0
  388. data/lib/expressir/express/subtype_constraint.rb +14 -0
  389. data/lib/expressir/express/type.rb +26 -0
  390. data/lib/expressir/express/type_aggregate.rb +42 -0
  391. data/lib/expressir/express/type_enum.rb +29 -0
  392. data/lib/expressir/express/type_parser.rb +45 -0
  393. data/lib/expressir/express/type_select.rb +82 -0
  394. data/lib/expressir/express/unique_rule.rb +35 -0
  395. data/lib/expressir/express/where_rule.rb +32 -0
  396. data/lib/expressir/express_exp/formatter.rb +1450 -0
  397. data/lib/expressir/express_exp/parser.rb +36 -0
  398. data/lib/expressir/express_exp/visitor.rb +2451 -0
  399. data/lib/expressir/express_parser.rb +30 -0
  400. data/lib/expressir/model.rb +65 -0
  401. data/lib/expressir/model/attribute.rb +27 -0
  402. data/lib/expressir/model/constant.rb +17 -0
  403. data/lib/expressir/model/entity.rb +46 -0
  404. data/lib/expressir/model/enumeration_item.rb +11 -0
  405. data/lib/expressir/model/expressions/aggregate_initializer.rb +13 -0
  406. data/lib/expressir/model/expressions/aggregate_item.rb +15 -0
  407. data/lib/expressir/model/expressions/attribute_reference.rb +15 -0
  408. data/lib/expressir/model/expressions/binary_expression.rb +40 -0
  409. data/lib/expressir/model/expressions/call.rb +15 -0
  410. data/lib/expressir/model/expressions/entity_constructor.rb +15 -0
  411. data/lib/expressir/model/expressions/group_reference.rb +15 -0
  412. data/lib/expressir/model/expressions/index_reference.rb +17 -0
  413. data/lib/expressir/model/expressions/interval.rb +21 -0
  414. data/lib/expressir/model/expressions/query_expression.rb +26 -0
  415. data/lib/expressir/model/expressions/simple_reference.rb +13 -0
  416. data/lib/expressir/model/expressions/unary_expression.rb +19 -0
  417. data/lib/expressir/model/function.rb +62 -0
  418. data/lib/expressir/model/identifier.rb +9 -0
  419. data/lib/expressir/model/interface.rb +18 -0
  420. data/lib/expressir/model/literals/binary.rb +13 -0
  421. data/lib/expressir/model/literals/integer.rb +13 -0
  422. data/lib/expressir/model/literals/logical.rb +17 -0
  423. data/lib/expressir/model/literals/real.rb +13 -0
  424. data/lib/expressir/model/literals/string.rb +15 -0
  425. data/lib/expressir/model/parameter.rb +17 -0
  426. data/lib/expressir/model/procedure.rb +60 -0
  427. data/lib/expressir/model/renamed_ref.rb +13 -0
  428. data/lib/expressir/model/repository.rb +19 -0
  429. data/lib/expressir/model/rule.rb +62 -0
  430. data/lib/expressir/model/schema.rb +67 -0
  431. data/lib/expressir/model/scope.rb +17 -0
  432. data/lib/expressir/model/statements/alias.rb +26 -0
  433. data/lib/expressir/model/statements/assignment.rb +15 -0
  434. data/lib/expressir/model/statements/call.rb +15 -0
  435. data/lib/expressir/model/statements/case.rb +17 -0
  436. data/lib/expressir/model/statements/case_action.rb +15 -0
  437. data/lib/expressir/model/statements/compound.rb +13 -0
  438. data/lib/expressir/model/statements/escape.rb +8 -0
  439. data/lib/expressir/model/statements/if.rb +17 -0
  440. data/lib/expressir/model/statements/null.rb +8 -0
  441. data/lib/expressir/model/statements/repeat.rb +34 -0
  442. data/lib/expressir/model/statements/return.rb +13 -0
  443. data/lib/expressir/model/statements/skip.rb +8 -0
  444. data/lib/expressir/model/subtype_constraint.rb +27 -0
  445. data/lib/expressir/model/type.rb +24 -0
  446. data/lib/expressir/model/types/aggregate.rb +17 -0
  447. data/lib/expressir/model/types/array.rb +21 -0
  448. data/lib/expressir/model/types/bag.rb +17 -0
  449. data/lib/expressir/model/types/binary.rb +15 -0
  450. data/lib/expressir/model/types/boolean.rb +8 -0
  451. data/lib/expressir/model/types/enumeration.rb +19 -0
  452. data/lib/expressir/model/types/generic.rb +13 -0
  453. data/lib/expressir/model/types/generic_entity.rb +13 -0
  454. data/lib/expressir/model/types/integer.rb +8 -0
  455. data/lib/expressir/model/types/list.rb +19 -0
  456. data/lib/expressir/model/types/logical.rb +8 -0
  457. data/lib/expressir/model/types/number.rb +8 -0
  458. data/lib/expressir/model/types/real.rb +13 -0
  459. data/lib/expressir/model/types/select.rb +21 -0
  460. data/lib/expressir/model/types/set.rb +17 -0
  461. data/lib/expressir/model/types/string.rb +15 -0
  462. data/lib/expressir/model/unique.rb +15 -0
  463. data/lib/expressir/model/variable.rb +17 -0
  464. data/lib/expressir/model/where.rb +15 -0
  465. data/lib/expressir/parser.rb +6 -0
  466. data/lib/expressir/parser/owl_parser.rb +8 -0
  467. data/lib/expressir/version.rb +3 -0
  468. data/original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.exp +9589 -0
  469. data/original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.owl +36619 -0
  470. data/original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.xml +13294 -0
  471. data/original/examples/employment/eclipse/.project +17 -0
  472. data/original/examples/employment/eclipse/Export/Employment.png +0 -0
  473. data/original/examples/employment/eclipse/Express/employment_schema.exp +33 -0
  474. data/original/examples/employment/eclipse/Express/employment_schema.xmi +77 -0
  475. data/original/examples/employment/eclipse/Express/employment_schema.xml +93 -0
  476. data/original/examples/employment/eclipse/Models/Employment.uml +4 -0
  477. data/original/examples/employment/eclipse/Models/Employment.umldi +240 -0
  478. data/original/examples/employment/eclipse/readme.txt +7 -0
  479. data/original/examples/employment/employment_schema.exp +33 -0
  480. data/original/examples/employment/employment_schema.rb +232 -0
  481. data/original/examples/employment/employment_schema.xml +93 -0
  482. data/original/examples/employment/employment_schema___module.rb +46 -0
  483. data/original/examples/employment/employment_schema___p28attr.rb +126 -0
  484. data/original/examples/employment/employment_schema___p28inst.rb +26 -0
  485. data/original/examples/employment/example_employment_data.xml +1 -0
  486. data/original/examples/employment/example_employment_data_copy.xml +1 -0
  487. data/original/examples/employment/example_employment_reader.rb +30 -0
  488. data/original/examples/employment/example_employment_writer.rb +51 -0
  489. data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.exp +3710 -0
  490. data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.owl +35880 -0
  491. data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.xmi +15357 -0
  492. data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.xml +9468 -0
  493. data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.exp +8404 -0
  494. data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.owl +43147 -0
  495. data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.xmi +18341 -0
  496. data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.xml +11632 -0
  497. data/original/examples/syntax/remark.exp +145 -0
  498. data/original/examples/syntax/remark_formatted.exp +174 -0
  499. data/original/examples/syntax/syntax.exp +310 -0
  500. data/original/examples/syntax/syntax_formatted.exp +1187 -0
  501. data/original/exp2ruby.rb +525 -0
  502. data/original/expsm.rb +34 -0
  503. data/original/mapping_owl.rb +1018 -0
  504. data/original/mapping_sysml.rb +2281 -0
  505. data/original/mapping_uml2.rb +599 -0
  506. data/original/mapping_uml2_eclipse.rb +433 -0
  507. data/original/reeper.rb +134 -0
  508. data/spec/acceptance/express_to_owl_spec.rb +18 -0
  509. data/spec/acceptance/version_spec.rb +12 -0
  510. data/spec/expressir/express/repository_spec.rb +25 -0
  511. data/spec/expressir/express_exp/ap233_spec.rb +22 -0
  512. data/spec/expressir/express_exp/format_remark_spec.rb +28 -0
  513. data/spec/expressir/express_exp/format_syntax_spec.rb +28 -0
  514. data/spec/expressir/express_exp/parse_remark_spec.rb +345 -0
  515. data/spec/expressir/express_exp/parse_syntax_spec.rb +2998 -0
  516. data/spec/expressir/model/find_spec.rb +110 -0
  517. data/spec/expressr_spec.rb +5 -0
  518. data/spec/spec_helper.rb +17 -0
  519. data/spec/support/console_helper.rb +29 -0
  520. metadata +695 -0
@@ -0,0 +1,2998 @@
1
+ require "spec_helper"
2
+ require "expressir/express_exp/parser"
3
+
4
+ RSpec.describe Expressir::ExpressExp::Parser do
5
+ describe ".from_file" do
6
+ it "build an instance from a file" do
7
+ repo = Expressir::ExpressExp::Parser.from_exp(sample_file)
8
+
9
+ schemas = repo.schemas
10
+
11
+ schema = schemas.find{|x| x.id == "syntax_schema"}
12
+ expect(schema.version).to be_instance_of(Expressir::Model::Literals::String)
13
+ expect(schema.version.value).to eq("version")
14
+
15
+ use_interfaces = schema.use_interfaces
16
+ reference_interfaces = schema.reference_interfaces
17
+ constants = schema.constants
18
+ types = schema.types
19
+ entities = schema.entities
20
+ subtype_constraints = schema.subtype_constraints
21
+ functions = schema.functions
22
+ procedures = schema.procedures
23
+ rules = schema.rules
24
+
25
+ # intefaces
26
+ use_interfaces[0].tap do |x|
27
+ expect(x).to be_instance_of(Expressir::Model::Interface)
28
+ expect(x.kind).to eq(Expressir::Model::Interface::USE)
29
+ expect(x.schema).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
30
+ expect(x.schema.id).to eq("contract_schema")
31
+ end
32
+
33
+ use_interfaces[1].tap do |x|
34
+ expect(x).to be_instance_of(Expressir::Model::Interface)
35
+ expect(x.kind).to eq(Expressir::Model::Interface::USE)
36
+ expect(x.schema).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
37
+ expect(x.schema.id).to eq("contract_schema")
38
+ expect(x.items).to be_instance_of(Array)
39
+ expect(x.items.count).to eq(1)
40
+ expect(x.items[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
41
+ expect(x.items[0].id).to eq("contract")
42
+ end
43
+
44
+ use_interfaces[2].tap do |x|
45
+ expect(x).to be_instance_of(Expressir::Model::Interface)
46
+ expect(x.kind).to eq(Expressir::Model::Interface::USE)
47
+ expect(x.schema).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
48
+ expect(x.schema.id).to eq("contract_schema")
49
+ expect(x.items).to be_instance_of(Array)
50
+ expect(x.items.count).to eq(1)
51
+ expect(x.items[0]).to be_instance_of(Expressir::Model::RenamedRef)
52
+ expect(x.items[0].ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
53
+ expect(x.items[0].ref.id).to eq("contract")
54
+ expect(x.items[0].id).to eq("contract2")
55
+ end
56
+
57
+ reference_interfaces[0].tap do |x|
58
+ expect(x).to be_instance_of(Expressir::Model::Interface)
59
+ expect(x.kind).to eq(Expressir::Model::Interface::REFERENCE)
60
+ expect(x.schema).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
61
+ expect(x.schema.id).to eq("contract_schema")
62
+ end
63
+
64
+ reference_interfaces[1].tap do |x|
65
+ expect(x).to be_instance_of(Expressir::Model::Interface)
66
+ expect(x.kind).to eq(Expressir::Model::Interface::REFERENCE)
67
+ expect(x.schema).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
68
+ expect(x.schema.id).to eq("contract_schema")
69
+ expect(x.items).to be_instance_of(Array)
70
+ expect(x.items.count).to eq(1)
71
+ expect(x.items[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
72
+ expect(x.items[0].id).to eq("contract")
73
+ end
74
+
75
+ reference_interfaces[2].tap do |x|
76
+ expect(x).to be_instance_of(Expressir::Model::Interface)
77
+ expect(x.kind).to eq(Expressir::Model::Interface::REFERENCE)
78
+ expect(x.schema).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
79
+ expect(x.schema.id).to eq("contract_schema")
80
+ expect(x.items).to be_instance_of(Array)
81
+ expect(x.items.count).to eq(1)
82
+ expect(x.items[0]).to be_instance_of(Expressir::Model::RenamedRef)
83
+ expect(x.items[0].ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
84
+ expect(x.items[0].ref.id).to eq("contract")
85
+ expect(x.items[0].id).to eq("contract2")
86
+ end
87
+
88
+ # constants
89
+ constants.find{|x| x.id == "empty_constant"}.tap do |x|
90
+ expect(x).to be_instance_of(Expressir::Model::Constant)
91
+ expect(x.type).to be_instance_of(Expressir::Model::Types::Boolean)
92
+ expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
93
+ expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
94
+ end
95
+
96
+ # types
97
+ types.find{|x| x.id == "empty_type"}.tap do |x|
98
+ expect(x).to be_instance_of(Expressir::Model::Type)
99
+ expect(x.type).to be_instance_of(Expressir::Model::Types::Boolean)
100
+ end
101
+
102
+ types.find{|x| x.id == "where_type"}.tap do |x|
103
+ expect(x).to be_instance_of(Expressir::Model::Type)
104
+ expect(x.type).to be_instance_of(Expressir::Model::Types::Boolean)
105
+ expect(x.where).to be_instance_of(Array)
106
+ expect(x.where.count).to eq(1)
107
+ expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
108
+ expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
109
+ expect(x.where[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
110
+ end
111
+
112
+ types.find{|x| x.id == "where_label_type"}.tap do |x|
113
+ expect(x).to be_instance_of(Expressir::Model::Type)
114
+ expect(x.type).to be_instance_of(Expressir::Model::Types::Boolean)
115
+ expect(x.where).to be_instance_of(Array)
116
+ expect(x.where.count).to eq(1)
117
+ expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
118
+ expect(x.where[0].id).to eq("WR1")
119
+ expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
120
+ expect(x.where[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
121
+ end
122
+
123
+ # entities
124
+ entities.find{|x| x.id == "empty_entity"}.tap do |x|
125
+ expect(x).to be_instance_of(Expressir::Model::Entity)
126
+ end
127
+
128
+ entities.find{|x| x.id == "abstract_entity"}.tap do |x|
129
+ expect(x).to be_instance_of(Expressir::Model::Entity)
130
+ expect(x.abstract).to eq(true)
131
+ end
132
+
133
+ entities.find{|x| x.id == "abstract_supertype_entity"}.tap do |x|
134
+ expect(x).to be_instance_of(Expressir::Model::Entity)
135
+ expect(x.abstract).to eq(true)
136
+ end
137
+
138
+ entities.find{|x| x.id == "abstract_supertype_constraint_entity"}.tap do |x|
139
+ expect(x).to be_instance_of(Expressir::Model::Entity)
140
+ expect(x.abstract).to eq(true)
141
+ expect(x.supertype_expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
142
+ expect(x.supertype_expression.id).to eq("empty_entity")
143
+ end
144
+
145
+ entities.find{|x| x.id == "supertype_constraint_entity"}.tap do |x|
146
+ expect(x).to be_instance_of(Expressir::Model::Entity)
147
+ expect(x.supertype_expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
148
+ expect(x.supertype_expression.id).to eq("empty_entity")
149
+ end
150
+
151
+ entities.find{|x| x.id == "subtype_entity"}.tap do |x|
152
+ expect(x).to be_instance_of(Expressir::Model::Entity)
153
+ expect(x.subtype_of).to be_instance_of(Array)
154
+ expect(x.subtype_of.count).to eq(1)
155
+ expect(x.subtype_of[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
156
+ expect(x.subtype_of[0].id).to eq("empty_entity")
157
+ end
158
+
159
+ entities.find{|x| x.id == "supertype_constraint_subtype_entity"}.tap do |x|
160
+ expect(x).to be_instance_of(Expressir::Model::Entity)
161
+ expect(x.supertype_expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
162
+ expect(x.supertype_expression.id).to eq("empty_entity")
163
+ expect(x.subtype_of).to be_instance_of(Array)
164
+ expect(x.subtype_of.count).to eq(1)
165
+ expect(x.subtype_of[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
166
+ expect(x.subtype_of[0].id).to eq("empty_entity")
167
+ end
168
+
169
+ entities.find{|x| x.id == "attribute_entity"}.tap do |x|
170
+ expect(x).to be_instance_of(Expressir::Model::Entity)
171
+ expect(x.attributes).to be_instance_of(Array)
172
+ expect(x.attributes.count).to eq(1)
173
+ expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
174
+ expect(x.attributes[0].id).to eq("test")
175
+ expect(x.attributes[0].kind).to eq(Expressir::Model::Attribute::EXPLICIT)
176
+ expect(x.attributes[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
177
+ end
178
+
179
+ entities.find{|x| x.id == "attribute_optional_entity"}.tap do |x|
180
+ expect(x).to be_instance_of(Expressir::Model::Entity)
181
+ expect(x.attributes).to be_instance_of(Array)
182
+ expect(x.attributes.count).to eq(1)
183
+ expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
184
+ expect(x.attributes[0].id).to eq("test")
185
+ expect(x.attributes[0].kind).to eq(Expressir::Model::Attribute::EXPLICIT)
186
+ expect(x.attributes[0].optional).to eq(true)
187
+ expect(x.attributes[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
188
+ end
189
+
190
+ entities.find{|x| x.id == "attribute_multiple_entity"}.tap do |x|
191
+ expect(x).to be_instance_of(Expressir::Model::Entity)
192
+ expect(x.attributes).to be_instance_of(Array)
193
+ expect(x.attributes.count).to eq(2)
194
+ expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
195
+ expect(x.attributes[0].id).to eq("test")
196
+ expect(x.attributes[0].kind).to eq(Expressir::Model::Attribute::EXPLICIT)
197
+ expect(x.attributes[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
198
+ expect(x.attributes[1]).to be_instance_of(Expressir::Model::Attribute)
199
+ expect(x.attributes[1].id).to eq("test2")
200
+ expect(x.attributes[1].kind).to eq(Expressir::Model::Attribute::EXPLICIT)
201
+ expect(x.attributes[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
202
+ end
203
+
204
+ entities.find{|x| x.id == "attribute_multiple_shorthand_entity"}.tap do |x|
205
+ expect(x).to be_instance_of(Expressir::Model::Entity)
206
+ expect(x.attributes).to be_instance_of(Array)
207
+ expect(x.attributes.count).to eq(2)
208
+ expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
209
+ expect(x.attributes[0].id).to eq("test")
210
+ expect(x.attributes[0].kind).to eq(Expressir::Model::Attribute::EXPLICIT)
211
+ expect(x.attributes[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
212
+ expect(x.attributes[1]).to be_instance_of(Expressir::Model::Attribute)
213
+ expect(x.attributes[1].id).to eq("test2")
214
+ expect(x.attributes[1].kind).to eq(Expressir::Model::Attribute::EXPLICIT)
215
+ expect(x.attributes[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
216
+ end
217
+
218
+ entities.find{|x| x.id == "attribute_redeclared_entity"}.tap do |x|
219
+ expect(x).to be_instance_of(Expressir::Model::Entity)
220
+ expect(x.attributes).to be_instance_of(Array)
221
+ expect(x.attributes.count).to eq(1)
222
+ expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
223
+ expect(x.attributes[0].kind).to eq(Expressir::Model::Attribute::EXPLICIT)
224
+ expect(x.attributes[0].supertype_attribute).to be_instance_of(Expressir::Model::Expressions::AttributeReference)
225
+ expect(x.attributes[0].supertype_attribute.ref).to be_instance_of(Expressir::Model::Expressions::GroupReference)
226
+ expect(x.attributes[0].supertype_attribute.ref.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
227
+ expect(x.attributes[0].supertype_attribute.ref.ref.id).to eq("SELF")
228
+ expect(x.attributes[0].supertype_attribute.ref.entity).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
229
+ expect(x.attributes[0].supertype_attribute.ref.entity.id).to eq("attribute_entity")
230
+ expect(x.attributes[0].supertype_attribute.attribute).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
231
+ expect(x.attributes[0].supertype_attribute.attribute.id).to eq("test")
232
+ expect(x.attributes[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
233
+ end
234
+
235
+ entities.find{|x| x.id == "attribute_redeclared_renamed_entity"}.tap do |x|
236
+ expect(x).to be_instance_of(Expressir::Model::Entity)
237
+ expect(x.attributes).to be_instance_of(Array)
238
+ expect(x.attributes.count).to eq(1)
239
+ expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
240
+ expect(x.attributes[0].id).to eq("test2")
241
+ expect(x.attributes[0].kind).to eq(Expressir::Model::Attribute::EXPLICIT)
242
+ expect(x.attributes[0].supertype_attribute).to be_instance_of(Expressir::Model::Expressions::AttributeReference)
243
+ expect(x.attributes[0].supertype_attribute.ref).to be_instance_of(Expressir::Model::Expressions::GroupReference)
244
+ expect(x.attributes[0].supertype_attribute.ref.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
245
+ expect(x.attributes[0].supertype_attribute.ref.ref.id).to eq("SELF")
246
+ expect(x.attributes[0].supertype_attribute.ref.entity).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
247
+ expect(x.attributes[0].supertype_attribute.ref.entity.id).to eq("attribute_entity")
248
+ expect(x.attributes[0].supertype_attribute.attribute).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
249
+ expect(x.attributes[0].supertype_attribute.attribute.id).to eq("test")
250
+ expect(x.attributes[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
251
+ end
252
+
253
+ entities.find{|x| x.id == "derived_attribute_entity"}.tap do |x|
254
+ expect(x).to be_instance_of(Expressir::Model::Entity)
255
+ expect(x.attributes).to be_instance_of(Array)
256
+ expect(x.attributes.count).to eq(1)
257
+ expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
258
+ expect(x.attributes[0].id).to eq("test")
259
+ expect(x.attributes[0].kind).to eq(Expressir::Model::Attribute::DERIVED)
260
+ expect(x.attributes[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
261
+ expect(x.attributes[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
262
+ expect(x.attributes[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
263
+ end
264
+
265
+ entities.find{|x| x.id == "derived_attribute_redeclared_entity"}.tap do |x|
266
+ expect(x).to be_instance_of(Expressir::Model::Entity)
267
+ expect(x.attributes).to be_instance_of(Array)
268
+ expect(x.attributes.count).to eq(1)
269
+ expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
270
+ expect(x.attributes[0].kind).to eq(Expressir::Model::Attribute::DERIVED)
271
+ expect(x.attributes[0].supertype_attribute).to be_instance_of(Expressir::Model::Expressions::AttributeReference)
272
+ expect(x.attributes[0].supertype_attribute.ref).to be_instance_of(Expressir::Model::Expressions::GroupReference)
273
+ expect(x.attributes[0].supertype_attribute.ref.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
274
+ expect(x.attributes[0].supertype_attribute.ref.ref.id).to eq("SELF")
275
+ expect(x.attributes[0].supertype_attribute.ref.entity).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
276
+ expect(x.attributes[0].supertype_attribute.ref.entity.id).to eq("attribute_entity")
277
+ expect(x.attributes[0].supertype_attribute.attribute).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
278
+ expect(x.attributes[0].supertype_attribute.attribute.id).to eq("test")
279
+ expect(x.attributes[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
280
+ expect(x.attributes[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
281
+ expect(x.attributes[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
282
+ end
283
+
284
+ entities.find{|x| x.id == "derived_attribute_redeclared_renamed_entity"}.tap do |x|
285
+ expect(x).to be_instance_of(Expressir::Model::Entity)
286
+ expect(x.attributes).to be_instance_of(Array)
287
+ expect(x.attributes.count).to eq(1)
288
+ expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
289
+ expect(x.attributes[0].id).to eq("test2")
290
+ expect(x.attributes[0].kind).to eq(Expressir::Model::Attribute::DERIVED)
291
+ expect(x.attributes[0].supertype_attribute).to be_instance_of(Expressir::Model::Expressions::AttributeReference)
292
+ expect(x.attributes[0].supertype_attribute.ref).to be_instance_of(Expressir::Model::Expressions::GroupReference)
293
+ expect(x.attributes[0].supertype_attribute.ref.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
294
+ expect(x.attributes[0].supertype_attribute.ref.ref.id).to eq("SELF")
295
+ expect(x.attributes[0].supertype_attribute.ref.entity).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
296
+ expect(x.attributes[0].supertype_attribute.ref.entity.id).to eq("attribute_entity")
297
+ expect(x.attributes[0].supertype_attribute.attribute).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
298
+ expect(x.attributes[0].supertype_attribute.attribute.id).to eq("test")
299
+ expect(x.attributes[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
300
+ expect(x.attributes[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
301
+ expect(x.attributes[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
302
+ end
303
+
304
+ entities.find{|x| x.id == "inverse_attribute_entity"}.tap do |x|
305
+ expect(x).to be_instance_of(Expressir::Model::Entity)
306
+ expect(x.attributes).to be_instance_of(Array)
307
+ expect(x.attributes.count).to eq(1)
308
+ expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
309
+ expect(x.attributes[0].id).to eq("test")
310
+ expect(x.attributes[0].kind).to eq(Expressir::Model::Attribute::INVERSE)
311
+ expect(x.attributes[0].type).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
312
+ expect(x.attributes[0].type.id).to eq("attribute_entity")
313
+ expect(x.attributes[0].expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
314
+ expect(x.attributes[0].expression.id).to eq("test")
315
+ end
316
+
317
+ entities.find{|x| x.id == "inverse_attribute_entity_entity"}.tap do |x|
318
+ expect(x).to be_instance_of(Expressir::Model::Entity)
319
+ expect(x.attributes).to be_instance_of(Array)
320
+ expect(x.attributes.count).to eq(1)
321
+ expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
322
+ expect(x.attributes[0].id).to eq("test")
323
+ expect(x.attributes[0].kind).to eq(Expressir::Model::Attribute::INVERSE)
324
+ expect(x.attributes[0].type).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
325
+ expect(x.attributes[0].type.id).to eq("attribute_entity")
326
+ expect(x.attributes[0].expression).to be_instance_of(Expressir::Model::Expressions::AttributeReference)
327
+ expect(x.attributes[0].expression.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
328
+ expect(x.attributes[0].expression.ref.id).to eq("attribute_entity")
329
+ expect(x.attributes[0].expression.attribute).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
330
+ expect(x.attributes[0].expression.attribute.id).to eq("test")
331
+ end
332
+
333
+ entities.find{|x| x.id == "inverse_attribute_set_entity"}.tap do |x|
334
+ expect(x).to be_instance_of(Expressir::Model::Entity)
335
+ expect(x.attributes).to be_instance_of(Array)
336
+ expect(x.attributes.count).to eq(1)
337
+ expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
338
+ expect(x.attributes[0].id).to eq("test")
339
+ expect(x.attributes[0].kind).to eq(Expressir::Model::Attribute::INVERSE)
340
+ expect(x.attributes[0].type).to be_instance_of(Expressir::Model::Types::Set)
341
+ expect(x.attributes[0].type.base_type).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
342
+ expect(x.attributes[0].type.base_type.id).to eq("attribute_entity")
343
+ expect(x.attributes[0].expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
344
+ expect(x.attributes[0].expression.id).to eq("test")
345
+ end
346
+
347
+ entities.find{|x| x.id == "inverse_attribute_set_bound_entity"}.tap do |x|
348
+ expect(x).to be_instance_of(Expressir::Model::Entity)
349
+ expect(x.attributes).to be_instance_of(Array)
350
+ expect(x.attributes.count).to eq(1)
351
+ expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
352
+ expect(x.attributes[0].id).to eq("test")
353
+ expect(x.attributes[0].kind).to eq(Expressir::Model::Attribute::INVERSE)
354
+ expect(x.attributes[0].type).to be_instance_of(Expressir::Model::Types::Set)
355
+ expect(x.attributes[0].type.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
356
+ expect(x.attributes[0].type.bound1.value).to eq("1")
357
+ expect(x.attributes[0].type.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
358
+ expect(x.attributes[0].type.bound2.value).to eq("9")
359
+ expect(x.attributes[0].type.base_type).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
360
+ expect(x.attributes[0].type.base_type.id).to eq("attribute_entity")
361
+ expect(x.attributes[0].expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
362
+ expect(x.attributes[0].expression.id).to eq("test")
363
+ end
364
+
365
+ entities.find{|x| x.id == "inverse_attribute_bag_entity"}.tap do |x|
366
+ expect(x).to be_instance_of(Expressir::Model::Entity)
367
+ expect(x.attributes).to be_instance_of(Array)
368
+ expect(x.attributes.count).to eq(1)
369
+ expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
370
+ expect(x.attributes[0].id).to eq("test")
371
+ expect(x.attributes[0].kind).to eq(Expressir::Model::Attribute::INVERSE)
372
+ expect(x.attributes[0].type).to be_instance_of(Expressir::Model::Types::Bag)
373
+ expect(x.attributes[0].type.base_type).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
374
+ expect(x.attributes[0].type.base_type.id).to eq("attribute_entity")
375
+ expect(x.attributes[0].expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
376
+ expect(x.attributes[0].expression.id).to eq("test")
377
+ end
378
+
379
+ entities.find{|x| x.id == "inverse_attribute_bag_bound_entity"}.tap do |x|
380
+ expect(x).to be_instance_of(Expressir::Model::Entity)
381
+ expect(x.attributes).to be_instance_of(Array)
382
+ expect(x.attributes.count).to eq(1)
383
+ expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
384
+ expect(x.attributes[0].id).to eq("test")
385
+ expect(x.attributes[0].kind).to eq(Expressir::Model::Attribute::INVERSE)
386
+ expect(x.attributes[0].type).to be_instance_of(Expressir::Model::Types::Bag)
387
+ expect(x.attributes[0].type.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
388
+ expect(x.attributes[0].type.bound1.value).to eq("1")
389
+ expect(x.attributes[0].type.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
390
+ expect(x.attributes[0].type.bound2.value).to eq("9")
391
+ expect(x.attributes[0].type.base_type).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
392
+ expect(x.attributes[0].type.base_type.id).to eq("attribute_entity")
393
+ expect(x.attributes[0].expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
394
+ expect(x.attributes[0].expression.id).to eq("test")
395
+ end
396
+
397
+ entities.find{|x| x.id == "inverse_attribute_redeclared_entity"}.tap do |x|
398
+ expect(x).to be_instance_of(Expressir::Model::Entity)
399
+ expect(x.attributes).to be_instance_of(Array)
400
+ expect(x.attributes.count).to eq(1)
401
+ expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
402
+ expect(x.attributes[0].kind).to eq(Expressir::Model::Attribute::INVERSE)
403
+ expect(x.attributes[0].supertype_attribute).to be_instance_of(Expressir::Model::Expressions::AttributeReference)
404
+ expect(x.attributes[0].supertype_attribute.ref).to be_instance_of(Expressir::Model::Expressions::GroupReference)
405
+ expect(x.attributes[0].supertype_attribute.ref.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
406
+ expect(x.attributes[0].supertype_attribute.ref.ref.id).to eq("SELF")
407
+ expect(x.attributes[0].supertype_attribute.ref.entity).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
408
+ expect(x.attributes[0].supertype_attribute.ref.entity.id).to eq("attribute_entity")
409
+ expect(x.attributes[0].supertype_attribute.attribute).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
410
+ expect(x.attributes[0].supertype_attribute.attribute.id).to eq("test")
411
+ expect(x.attributes[0].type).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
412
+ expect(x.attributes[0].type.id).to eq("attribute_entity")
413
+ expect(x.attributes[0].expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
414
+ expect(x.attributes[0].expression.id).to eq("test")
415
+ end
416
+
417
+ entities.find{|x| x.id == "inverse_attribute_redeclared_renamed_entity"}.tap do |x|
418
+ expect(x).to be_instance_of(Expressir::Model::Entity)
419
+ expect(x.attributes).to be_instance_of(Array)
420
+ expect(x.attributes.count).to eq(1)
421
+ expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
422
+ expect(x.attributes[0].id).to eq("test2")
423
+ expect(x.attributes[0].kind).to eq(Expressir::Model::Attribute::INVERSE)
424
+ expect(x.attributes[0].supertype_attribute).to be_instance_of(Expressir::Model::Expressions::AttributeReference)
425
+ expect(x.attributes[0].supertype_attribute.ref).to be_instance_of(Expressir::Model::Expressions::GroupReference)
426
+ expect(x.attributes[0].supertype_attribute.ref.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
427
+ expect(x.attributes[0].supertype_attribute.ref.ref.id).to eq("SELF")
428
+ expect(x.attributes[0].supertype_attribute.ref.entity).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
429
+ expect(x.attributes[0].supertype_attribute.ref.entity.id).to eq("attribute_entity")
430
+ expect(x.attributes[0].supertype_attribute.attribute).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
431
+ expect(x.attributes[0].supertype_attribute.attribute.id).to eq("test")
432
+ expect(x.attributes[0].type).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
433
+ expect(x.attributes[0].type.id).to eq("attribute_entity")
434
+ expect(x.attributes[0].expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
435
+ expect(x.attributes[0].expression.id).to eq("test")
436
+ end
437
+
438
+ entities.find{|x| x.id == "unique_entity"}.tap do |x|
439
+ expect(x).to be_instance_of(Expressir::Model::Entity)
440
+ expect(x.attributes).to be_instance_of(Array)
441
+ expect(x.attributes.count).to eq(1)
442
+ expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
443
+ expect(x.attributes[0].id).to eq("test")
444
+ expect(x.attributes[0].kind).to eq(Expressir::Model::Attribute::EXPLICIT)
445
+ expect(x.attributes[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
446
+ expect(x.unique).to be_instance_of(Array)
447
+ expect(x.unique.count).to eq(1)
448
+ expect(x.unique[0]).to be_instance_of(Expressir::Model::Unique)
449
+ expect(x.unique[0].attributes).to be_instance_of(Array)
450
+ expect(x.unique[0].attributes.count).to eq(1)
451
+ expect(x.unique[0].attributes[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
452
+ expect(x.unique[0].attributes[0].id).to eq("test")
453
+ end
454
+
455
+ entities.find{|x| x.id == "unique_label_entity"}.tap do |x|
456
+ expect(x).to be_instance_of(Expressir::Model::Entity)
457
+ expect(x.attributes).to be_instance_of(Array)
458
+ expect(x.attributes.count).to eq(1)
459
+ expect(x.attributes[0]).to be_instance_of(Expressir::Model::Attribute)
460
+ expect(x.attributes[0].id).to eq("test")
461
+ expect(x.attributes[0].kind).to eq(Expressir::Model::Attribute::EXPLICIT)
462
+ expect(x.attributes[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
463
+ expect(x.unique).to be_instance_of(Array)
464
+ expect(x.unique.count).to eq(1)
465
+ expect(x.unique[0]).to be_instance_of(Expressir::Model::Unique)
466
+ expect(x.unique[0].id).to eq("UR1")
467
+ expect(x.unique[0].attributes).to be_instance_of(Array)
468
+ expect(x.unique[0].attributes.count).to eq(1)
469
+ expect(x.unique[0].attributes[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
470
+ expect(x.unique[0].attributes[0].id).to eq("test")
471
+ end
472
+
473
+ entities.find{|x| x.id == "unique_qualified_entity"}.tap do |x|
474
+ expect(x).to be_instance_of(Expressir::Model::Entity)
475
+ expect(x.unique).to be_instance_of(Array)
476
+ expect(x.unique.count).to eq(1)
477
+ expect(x.unique[0]).to be_instance_of(Expressir::Model::Unique)
478
+ expect(x.unique[0].attributes).to be_instance_of(Array)
479
+ expect(x.unique[0].attributes.count).to eq(1)
480
+ expect(x.unique[0].attributes[0]).to be_instance_of(Expressir::Model::Expressions::AttributeReference)
481
+ expect(x.unique[0].attributes[0].ref).to be_instance_of(Expressir::Model::Expressions::GroupReference)
482
+ expect(x.unique[0].attributes[0].ref.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
483
+ expect(x.unique[0].attributes[0].ref.ref.id).to eq("SELF")
484
+ expect(x.unique[0].attributes[0].ref.entity).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
485
+ expect(x.unique[0].attributes[0].ref.entity.id).to eq("attribute_entity")
486
+ expect(x.unique[0].attributes[0].attribute).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
487
+ expect(x.unique[0].attributes[0].attribute.id).to eq("test")
488
+ end
489
+
490
+ entities.find{|x| x.id == "unique_label_entity"}.tap do |x|
491
+ expect(x).to be_instance_of(Expressir::Model::Entity)
492
+ expect(x.unique).to be_instance_of(Array)
493
+ expect(x.unique.count).to eq(1)
494
+ expect(x.unique[0]).to be_instance_of(Expressir::Model::Unique)
495
+ expect(x.unique[0].id).to eq("UR1")
496
+ expect(x.unique[0].attributes).to be_instance_of(Array)
497
+ expect(x.unique[0].attributes.count).to eq(1)
498
+ expect(x.unique[0].attributes[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
499
+ expect(x.unique[0].attributes[0].id).to eq("test")
500
+ end
501
+
502
+ entities.find{|x| x.id == "unique_label_qualified_entity"}.tap do |x|
503
+ expect(x).to be_instance_of(Expressir::Model::Entity)
504
+ expect(x.unique).to be_instance_of(Array)
505
+ expect(x.unique.count).to eq(1)
506
+ expect(x.unique[0]).to be_instance_of(Expressir::Model::Unique)
507
+ expect(x.unique[0].id).to eq("UR1")
508
+ expect(x.unique[0].attributes).to be_instance_of(Array)
509
+ expect(x.unique[0].attributes.count).to eq(1)
510
+ expect(x.unique[0].attributes[0]).to be_instance_of(Expressir::Model::Expressions::AttributeReference)
511
+ expect(x.unique[0].attributes[0].ref).to be_instance_of(Expressir::Model::Expressions::GroupReference)
512
+ expect(x.unique[0].attributes[0].ref.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
513
+ expect(x.unique[0].attributes[0].ref.ref.id).to eq("SELF")
514
+ expect(x.unique[0].attributes[0].ref.entity).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
515
+ expect(x.unique[0].attributes[0].ref.entity.id).to eq("attribute_entity")
516
+ expect(x.unique[0].attributes[0].attribute).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
517
+ expect(x.unique[0].attributes[0].attribute.id).to eq("test")
518
+ end
519
+
520
+ entities.find{|x| x.id == "where_entity"}.tap do |x|
521
+ expect(x).to be_instance_of(Expressir::Model::Entity)
522
+ expect(x.where).to be_instance_of(Array)
523
+ expect(x.where.count).to eq(1)
524
+ expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
525
+ expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
526
+ expect(x.where[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
527
+ end
528
+
529
+ entities.find{|x| x.id == "where_label_entity"}.tap do |x|
530
+ expect(x).to be_instance_of(Expressir::Model::Entity)
531
+ expect(x.where).to be_instance_of(Array)
532
+ expect(x.where.count).to eq(1)
533
+ expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
534
+ expect(x.where[0].id).to eq("WR1")
535
+ expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
536
+ expect(x.where[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
537
+ end
538
+
539
+ # subtype constraints
540
+ subtype_constraints.find{|x| x.id == "empty_subtype_constraint"}.tap do |x|
541
+ expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
542
+ expect(x.applies_to).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
543
+ expect(x.applies_to.id).to eq("empty_entity")
544
+ end
545
+
546
+ subtype_constraints.find{|x| x.id == "abstract_supertype_subtype_constraint"}.tap do |x|
547
+ expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
548
+ expect(x.applies_to).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
549
+ expect(x.applies_to.id).to eq("empty_entity")
550
+ expect(x.abstract).to eq(true)
551
+ end
552
+
553
+ subtype_constraints.find{|x| x.id == "total_over_subtype_constraint"}.tap do |x|
554
+ expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
555
+ expect(x.applies_to).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
556
+ expect(x.applies_to.id).to eq("empty_entity")
557
+ expect(x.total_over).to be_instance_of(Array)
558
+ expect(x.total_over.count).to eq(1)
559
+ expect(x.total_over[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
560
+ expect(x.total_over[0].id).to eq("a")
561
+ end
562
+
563
+ subtype_constraints.find{|x| x.id == "supertype_expression_subtype_constraint"}.tap do |x|
564
+ expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
565
+ expect(x.applies_to).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
566
+ expect(x.applies_to.id).to eq("empty_entity")
567
+ expect(x.supertype_expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
568
+ expect(x.supertype_expression.id).to eq("a")
569
+ end
570
+
571
+ subtype_constraints.find{|x| x.id == "supertype_expression_andor_subtype_constraint"}.tap do |x|
572
+ expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
573
+ expect(x.applies_to).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
574
+ expect(x.applies_to.id).to eq("empty_entity")
575
+ expect(x.supertype_expression).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
576
+ expect(x.supertype_expression.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ANDOR)
577
+ expect(x.supertype_expression.operand1).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
578
+ expect(x.supertype_expression.operand1.id).to eq("a")
579
+ expect(x.supertype_expression.operand2).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
580
+ expect(x.supertype_expression.operand2.id).to eq("b")
581
+ end
582
+
583
+ subtype_constraints.find{|x| x.id == "supertype_expression_and_subtype_constraint"}.tap do |x|
584
+ expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
585
+ expect(x.applies_to).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
586
+ expect(x.applies_to.id).to eq("empty_entity")
587
+ expect(x.supertype_expression).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
588
+ expect(x.supertype_expression.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
589
+ expect(x.supertype_expression.operand1).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
590
+ expect(x.supertype_expression.operand1.id).to eq("a")
591
+ expect(x.supertype_expression.operand2).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
592
+ expect(x.supertype_expression.operand2.id).to eq("b")
593
+ end
594
+
595
+ subtype_constraints.find{|x| x.id == "supertype_expression_andor_and_subtype_constraint"}.tap do |x|
596
+ expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
597
+ expect(x.applies_to).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
598
+ expect(x.applies_to.id).to eq("empty_entity")
599
+ expect(x.supertype_expression).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
600
+ expect(x.supertype_expression.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ANDOR)
601
+ expect(x.supertype_expression.operand1).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
602
+ expect(x.supertype_expression.operand1.id).to eq("a")
603
+ expect(x.supertype_expression.operand2).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
604
+ expect(x.supertype_expression.operand2.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
605
+ expect(x.supertype_expression.operand2.operand1).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
606
+ expect(x.supertype_expression.operand2.operand1.id).to eq("b")
607
+ expect(x.supertype_expression.operand2.operand2).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
608
+ expect(x.supertype_expression.operand2.operand2.id).to eq("c")
609
+ end
610
+
611
+ subtype_constraints.find{|x| x.id == "supertype_expression_and_andor_subtype_constraint"}.tap do |x|
612
+ expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
613
+ expect(x.applies_to).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
614
+ expect(x.applies_to.id).to eq("empty_entity")
615
+ expect(x.supertype_expression).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
616
+ expect(x.supertype_expression.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ANDOR)
617
+ expect(x.supertype_expression.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
618
+ expect(x.supertype_expression.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
619
+ expect(x.supertype_expression.operand1.operand1).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
620
+ expect(x.supertype_expression.operand1.operand1.id).to eq("a")
621
+ expect(x.supertype_expression.operand1.operand2).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
622
+ expect(x.supertype_expression.operand1.operand2.id).to eq("b")
623
+ expect(x.supertype_expression.operand2).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
624
+ expect(x.supertype_expression.operand2.id).to eq("c")
625
+ end
626
+
627
+ subtype_constraints.find{|x| x.id == "supertype_expression_parenthesis_andor_and_subtype_constraint"}.tap do |x|
628
+ expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
629
+ expect(x.applies_to).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
630
+ expect(x.applies_to.id).to eq("empty_entity")
631
+ expect(x.supertype_expression).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
632
+ expect(x.supertype_expression.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
633
+ expect(x.supertype_expression.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
634
+ expect(x.supertype_expression.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ANDOR)
635
+ expect(x.supertype_expression.operand1.operand1).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
636
+ expect(x.supertype_expression.operand1.operand1.id).to eq("a")
637
+ expect(x.supertype_expression.operand1.operand2).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
638
+ expect(x.supertype_expression.operand1.operand2.id).to eq("b")
639
+ expect(x.supertype_expression.operand2).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
640
+ expect(x.supertype_expression.operand2.id).to eq("c")
641
+ end
642
+
643
+ subtype_constraints.find{|x| x.id == "supertype_expression_and_parenthesis_andor_subtype_constraint"}.tap do |x|
644
+ expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
645
+ expect(x.applies_to).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
646
+ expect(x.applies_to.id).to eq("empty_entity")
647
+ expect(x.supertype_expression).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
648
+ expect(x.supertype_expression.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
649
+ expect(x.supertype_expression.operand1).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
650
+ expect(x.supertype_expression.operand1.id).to eq("a")
651
+ expect(x.supertype_expression.operand2).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
652
+ expect(x.supertype_expression.operand2.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ANDOR)
653
+ expect(x.supertype_expression.operand2.operand1).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
654
+ expect(x.supertype_expression.operand2.operand1.id).to eq("b")
655
+ expect(x.supertype_expression.operand2.operand2).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
656
+ expect(x.supertype_expression.operand2.operand2.id).to eq("c")
657
+ end
658
+
659
+ subtype_constraints.find{|x| x.id == "supertype_expression_oneof_subtype_constraint"}.tap do |x|
660
+ expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
661
+ expect(x.applies_to).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
662
+ expect(x.applies_to.id).to eq("empty_entity")
663
+ expect(x.supertype_expression).to be_instance_of(Expressir::Model::Expressions::Call)
664
+ expect(x.supertype_expression.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
665
+ expect(x.supertype_expression.ref.id).to eq("ONEOF")
666
+ expect(x.supertype_expression.parameters).to be_instance_of(Array)
667
+ expect(x.supertype_expression.parameters.count).to eq(2)
668
+ expect(x.supertype_expression.parameters[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
669
+ expect(x.supertype_expression.parameters[0].id).to eq("a")
670
+ expect(x.supertype_expression.parameters[1]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
671
+ expect(x.supertype_expression.parameters[1].id).to eq("b")
672
+ end
673
+
674
+ subtype_constraints.find{|x| x.id == "supertype_expression_and_oneof_subtype_constraint"}.tap do |x|
675
+ expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
676
+ expect(x.applies_to).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
677
+ expect(x.applies_to.id).to eq("empty_entity")
678
+ expect(x.supertype_expression).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
679
+ expect(x.supertype_expression.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
680
+ expect(x.supertype_expression.operand1).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
681
+ expect(x.supertype_expression.operand1.id).to eq("a")
682
+ expect(x.supertype_expression.operand2).to be_instance_of(Expressir::Model::Expressions::Call)
683
+ expect(x.supertype_expression.operand2.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
684
+ expect(x.supertype_expression.operand2.ref.id).to eq("ONEOF")
685
+ expect(x.supertype_expression.operand2.parameters).to be_instance_of(Array)
686
+ expect(x.supertype_expression.operand2.parameters.count).to eq(2)
687
+ expect(x.supertype_expression.operand2.parameters[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
688
+ expect(x.supertype_expression.operand2.parameters[0].id).to eq("b")
689
+ expect(x.supertype_expression.operand2.parameters[1]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
690
+ expect(x.supertype_expression.operand2.parameters[1].id).to eq("c")
691
+ end
692
+
693
+ subtype_constraints.find{|x| x.id == "supertype_expression_andor_oneof_subtype_constraint"}.tap do |x|
694
+ expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
695
+ expect(x.applies_to).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
696
+ expect(x.applies_to.id).to eq("empty_entity")
697
+ expect(x.supertype_expression).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
698
+ expect(x.supertype_expression.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ANDOR)
699
+ expect(x.supertype_expression.operand1).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
700
+ expect(x.supertype_expression.operand1.id).to eq("a")
701
+ expect(x.supertype_expression.operand2).to be_instance_of(Expressir::Model::Expressions::Call)
702
+ expect(x.supertype_expression.operand2.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
703
+ expect(x.supertype_expression.operand2.ref.id).to eq("ONEOF")
704
+ expect(x.supertype_expression.operand2.parameters).to be_instance_of(Array)
705
+ expect(x.supertype_expression.operand2.parameters.count).to eq(2)
706
+ expect(x.supertype_expression.operand2.parameters[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
707
+ expect(x.supertype_expression.operand2.parameters[0].id).to eq("b")
708
+ expect(x.supertype_expression.operand2.parameters[1]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
709
+ expect(x.supertype_expression.operand2.parameters[1].id).to eq("c")
710
+ end
711
+
712
+ subtype_constraints.find{|x| x.id == "supertype_expression_oneof_and_subtype_constraint"}.tap do |x|
713
+ expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
714
+ expect(x.applies_to).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
715
+ expect(x.applies_to.id).to eq("empty_entity")
716
+ expect(x.supertype_expression).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
717
+ expect(x.supertype_expression.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
718
+ expect(x.supertype_expression.operand1).to be_instance_of(Expressir::Model::Expressions::Call)
719
+ expect(x.supertype_expression.operand1.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
720
+ expect(x.supertype_expression.operand1.ref.id).to eq("ONEOF")
721
+ expect(x.supertype_expression.operand1.parameters).to be_instance_of(Array)
722
+ expect(x.supertype_expression.operand1.parameters.count).to eq(2)
723
+ expect(x.supertype_expression.operand1.parameters[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
724
+ expect(x.supertype_expression.operand1.parameters[0].id).to eq("a")
725
+ expect(x.supertype_expression.operand1.parameters[1]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
726
+ expect(x.supertype_expression.operand1.parameters[1].id).to eq("b")
727
+ expect(x.supertype_expression.operand2).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
728
+ expect(x.supertype_expression.operand2.id).to eq("c")
729
+ end
730
+
731
+ subtype_constraints.find{|x| x.id == "supertype_expression_oneof_andor_subtype_constraint"}.tap do |x|
732
+ expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
733
+ expect(x.applies_to).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
734
+ expect(x.applies_to.id).to eq("empty_entity")
735
+ expect(x.supertype_expression).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
736
+ expect(x.supertype_expression.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ANDOR)
737
+ expect(x.supertype_expression.operand1).to be_instance_of(Expressir::Model::Expressions::Call)
738
+ expect(x.supertype_expression.operand1.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
739
+ expect(x.supertype_expression.operand1.ref.id).to eq("ONEOF")
740
+ expect(x.supertype_expression.operand1.parameters).to be_instance_of(Array)
741
+ expect(x.supertype_expression.operand1.parameters.count).to eq(2)
742
+ expect(x.supertype_expression.operand1.parameters[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
743
+ expect(x.supertype_expression.operand1.parameters[0].id).to eq("a")
744
+ expect(x.supertype_expression.operand1.parameters[1]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
745
+ expect(x.supertype_expression.operand1.parameters[1].id).to eq("b")
746
+ expect(x.supertype_expression.operand2).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
747
+ expect(x.supertype_expression.operand2.id).to eq("c")
748
+ end
749
+
750
+ subtype_constraints.find{|x| x.id == "supertype_expression_oneof_and_oneof_subtype_constraint"}.tap do |x|
751
+ expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
752
+ expect(x.applies_to).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
753
+ expect(x.applies_to.id).to eq("empty_entity")
754
+ expect(x.supertype_expression).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
755
+ expect(x.supertype_expression.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
756
+ expect(x.supertype_expression.operand1).to be_instance_of(Expressir::Model::Expressions::Call)
757
+ expect(x.supertype_expression.operand1.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
758
+ expect(x.supertype_expression.operand1.ref.id).to eq("ONEOF")
759
+ expect(x.supertype_expression.operand1.parameters).to be_instance_of(Array)
760
+ expect(x.supertype_expression.operand1.parameters.count).to eq(2)
761
+ expect(x.supertype_expression.operand1.parameters[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
762
+ expect(x.supertype_expression.operand1.parameters[0].id).to eq("a")
763
+ expect(x.supertype_expression.operand1.parameters[1]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
764
+ expect(x.supertype_expression.operand1.parameters[1].id).to eq("b")
765
+ expect(x.supertype_expression.operand2).to be_instance_of(Expressir::Model::Expressions::Call)
766
+ expect(x.supertype_expression.operand2.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
767
+ expect(x.supertype_expression.operand2.ref.id).to eq("ONEOF")
768
+ expect(x.supertype_expression.operand2.parameters).to be_instance_of(Array)
769
+ expect(x.supertype_expression.operand2.parameters.count).to eq(2)
770
+ expect(x.supertype_expression.operand2.parameters[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
771
+ expect(x.supertype_expression.operand2.parameters[0].id).to eq("c")
772
+ expect(x.supertype_expression.operand2.parameters[1]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
773
+ expect(x.supertype_expression.operand2.parameters[1].id).to eq("d")
774
+ end
775
+
776
+ subtype_constraints.find{|x| x.id == "supertype_expression_oneof_andor_oneof_subtype_constraint"}.tap do |x|
777
+ expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
778
+ expect(x.applies_to).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
779
+ expect(x.applies_to.id).to eq("empty_entity")
780
+ expect(x.supertype_expression).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
781
+ expect(x.supertype_expression.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ANDOR)
782
+ expect(x.supertype_expression.operand1).to be_instance_of(Expressir::Model::Expressions::Call)
783
+ expect(x.supertype_expression.operand1.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
784
+ expect(x.supertype_expression.operand1.ref.id).to eq("ONEOF")
785
+ expect(x.supertype_expression.operand1.parameters).to be_instance_of(Array)
786
+ expect(x.supertype_expression.operand1.parameters.count).to eq(2)
787
+ expect(x.supertype_expression.operand1.parameters[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
788
+ expect(x.supertype_expression.operand1.parameters[0].id).to eq("a")
789
+ expect(x.supertype_expression.operand1.parameters[1]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
790
+ expect(x.supertype_expression.operand1.parameters[1].id).to eq("b")
791
+ expect(x.supertype_expression.operand2).to be_instance_of(Expressir::Model::Expressions::Call)
792
+ expect(x.supertype_expression.operand2.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
793
+ expect(x.supertype_expression.operand2.ref.id).to eq("ONEOF")
794
+ expect(x.supertype_expression.operand2.parameters).to be_instance_of(Array)
795
+ expect(x.supertype_expression.operand2.parameters.count).to eq(2)
796
+ expect(x.supertype_expression.operand2.parameters[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
797
+ expect(x.supertype_expression.operand2.parameters[0].id).to eq("c")
798
+ expect(x.supertype_expression.operand2.parameters[1]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
799
+ expect(x.supertype_expression.operand2.parameters[1].id).to eq("d")
800
+ end
801
+
802
+ # functions
803
+ functions.find{|x| x.id == "empty_function"}.tap do |x|
804
+ expect(x).to be_instance_of(Expressir::Model::Function)
805
+ expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
806
+ expect(x.statements).to be_instance_of(Array)
807
+ expect(x.statements.count).to eq(1)
808
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
809
+ end
810
+
811
+ functions.find{|x| x.id == "parameter_function"}.tap do |x|
812
+ expect(x).to be_instance_of(Expressir::Model::Function)
813
+ expect(x.parameters).to be_instance_of(Array)
814
+ expect(x.parameters.count).to eq(1)
815
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Parameter)
816
+ expect(x.parameters[0].id).to eq("test")
817
+ expect(x.parameters[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
818
+ expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
819
+ expect(x.statements).to be_instance_of(Array)
820
+ expect(x.statements.count).to eq(1)
821
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
822
+ end
823
+
824
+ functions.find{|x| x.id == "multiple_parameter_function"}.tap do |x|
825
+ expect(x).to be_instance_of(Expressir::Model::Function)
826
+ expect(x.parameters).to be_instance_of(Array)
827
+ expect(x.parameters.count).to eq(2)
828
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Parameter)
829
+ expect(x.parameters[0].id).to eq("test")
830
+ expect(x.parameters[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
831
+ expect(x.parameters[1]).to be_instance_of(Expressir::Model::Parameter)
832
+ expect(x.parameters[1].id).to eq("test2")
833
+ expect(x.parameters[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
834
+ expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
835
+ expect(x.statements).to be_instance_of(Array)
836
+ expect(x.statements.count).to eq(1)
837
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
838
+ end
839
+
840
+ functions.find{|x| x.id == "multiple_shorthand_parameter_function"}.tap do |x|
841
+ expect(x).to be_instance_of(Expressir::Model::Function)
842
+ expect(x.parameters).to be_instance_of(Array)
843
+ expect(x.parameters.count).to eq(2)
844
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Parameter)
845
+ expect(x.parameters[0].id).to eq("test")
846
+ expect(x.parameters[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
847
+ expect(x.parameters[1]).to be_instance_of(Expressir::Model::Parameter)
848
+ expect(x.parameters[1].id).to eq("test2")
849
+ expect(x.parameters[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
850
+ expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
851
+ expect(x.statements).to be_instance_of(Array)
852
+ expect(x.statements.count).to eq(1)
853
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
854
+ end
855
+
856
+ functions.find{|x| x.id == "type_function"}.tap do |x|
857
+ expect(x).to be_instance_of(Expressir::Model::Function)
858
+ expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
859
+ expect(x.declarations).to be_instance_of(Array)
860
+ expect(x.declarations.count).to eq(1)
861
+ expect(x.declarations[0]).to be_instance_of(Expressir::Model::Type)
862
+ expect(x.declarations[0].id).to eq("test")
863
+ expect(x.declarations[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
864
+ expect(x.statements).to be_instance_of(Array)
865
+ expect(x.statements.count).to eq(1)
866
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
867
+ end
868
+
869
+ functions.find{|x| x.id == "constant_function"}.tap do |x|
870
+ expect(x).to be_instance_of(Expressir::Model::Function)
871
+ expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
872
+ expect(x.constants).to be_instance_of(Array)
873
+ expect(x.constants.count).to eq(1)
874
+ expect(x.constants[0]).to be_instance_of(Expressir::Model::Constant)
875
+ expect(x.constants[0].id).to eq("test")
876
+ expect(x.constants[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
877
+ expect(x.constants[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
878
+ expect(x.constants[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
879
+ expect(x.statements).to be_instance_of(Array)
880
+ expect(x.statements.count).to eq(1)
881
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
882
+ end
883
+
884
+ functions.find{|x| x.id == "multiple_constant_function"}.tap do |x|
885
+ expect(x).to be_instance_of(Expressir::Model::Function)
886
+ expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
887
+ expect(x.constants).to be_instance_of(Array)
888
+ expect(x.constants.count).to eq(2)
889
+ expect(x.constants[0]).to be_instance_of(Expressir::Model::Constant)
890
+ expect(x.constants[0].id).to eq("test")
891
+ expect(x.constants[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
892
+ expect(x.constants[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
893
+ expect(x.constants[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
894
+ expect(x.constants[1]).to be_instance_of(Expressir::Model::Constant)
895
+ expect(x.constants[1].id).to eq("test2")
896
+ expect(x.constants[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
897
+ expect(x.constants[1].expression).to be_instance_of(Expressir::Model::Literals::Logical)
898
+ expect(x.constants[1].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
899
+ expect(x.statements).to be_instance_of(Array)
900
+ expect(x.statements.count).to eq(1)
901
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
902
+ end
903
+
904
+ functions.find{|x| x.id == "variable_function"}.tap do |x|
905
+ expect(x).to be_instance_of(Expressir::Model::Function)
906
+ expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
907
+ expect(x.variables).to be_instance_of(Array)
908
+ expect(x.variables.count).to eq(1)
909
+ expect(x.variables[0]).to be_instance_of(Expressir::Model::Variable)
910
+ expect(x.variables[0].id).to eq("test")
911
+ expect(x.variables[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
912
+ expect(x.statements).to be_instance_of(Array)
913
+ expect(x.statements.count).to eq(1)
914
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
915
+ end
916
+
917
+ functions.find{|x| x.id == "multiple_variable_function"}.tap do |x|
918
+ expect(x).to be_instance_of(Expressir::Model::Function)
919
+ expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
920
+ expect(x.variables).to be_instance_of(Array)
921
+ expect(x.variables.count).to eq(2)
922
+ expect(x.variables[0]).to be_instance_of(Expressir::Model::Variable)
923
+ expect(x.variables[0].id).to eq("test")
924
+ expect(x.variables[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
925
+ expect(x.variables[1]).to be_instance_of(Expressir::Model::Variable)
926
+ expect(x.variables[1].id).to eq("test2")
927
+ expect(x.variables[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
928
+ expect(x.statements).to be_instance_of(Array)
929
+ expect(x.statements.count).to eq(1)
930
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
931
+ end
932
+
933
+ functions.find{|x| x.id == "multiple_shorthand_variable_function"}.tap do |x|
934
+ expect(x).to be_instance_of(Expressir::Model::Function)
935
+ expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
936
+ expect(x.variables).to be_instance_of(Array)
937
+ expect(x.variables.count).to eq(2)
938
+ expect(x.variables[0]).to be_instance_of(Expressir::Model::Variable)
939
+ expect(x.variables[0].id).to eq("test")
940
+ expect(x.variables[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
941
+ expect(x.variables[1]).to be_instance_of(Expressir::Model::Variable)
942
+ expect(x.variables[1].id).to eq("test2")
943
+ expect(x.variables[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
944
+ expect(x.statements).to be_instance_of(Array)
945
+ expect(x.statements.count).to eq(1)
946
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
947
+ end
948
+
949
+ functions.find{|x| x.id == "variable_expression_function"}.tap do |x|
950
+ expect(x).to be_instance_of(Expressir::Model::Function)
951
+ expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
952
+ expect(x.variables).to be_instance_of(Array)
953
+ expect(x.variables.count).to eq(1)
954
+ expect(x.variables[0]).to be_instance_of(Expressir::Model::Variable)
955
+ expect(x.variables[0].id).to eq("test")
956
+ expect(x.variables[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
957
+ expect(x.variables[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
958
+ expect(x.variables[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
959
+ expect(x.statements).to be_instance_of(Array)
960
+ expect(x.statements.count).to eq(1)
961
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
962
+ end
963
+
964
+ functions.find{|x| x.id == "multiple_variable_expression_function"}.tap do |x|
965
+ expect(x).to be_instance_of(Expressir::Model::Function)
966
+ expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
967
+ expect(x.variables).to be_instance_of(Array)
968
+ expect(x.variables.count).to eq(2)
969
+ expect(x.variables[0]).to be_instance_of(Expressir::Model::Variable)
970
+ expect(x.variables[0].id).to eq("test")
971
+ expect(x.variables[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
972
+ expect(x.variables[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
973
+ expect(x.variables[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
974
+ expect(x.variables[1]).to be_instance_of(Expressir::Model::Variable)
975
+ expect(x.variables[1].id).to eq("test2")
976
+ expect(x.variables[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
977
+ expect(x.variables[1].expression).to be_instance_of(Expressir::Model::Literals::Logical)
978
+ expect(x.variables[1].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
979
+ expect(x.statements).to be_instance_of(Array)
980
+ expect(x.statements.count).to eq(1)
981
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
982
+ end
983
+
984
+ functions.find{|x| x.id == "multiple_shorthand_variable_expression_function"}.tap do |x|
985
+ expect(x).to be_instance_of(Expressir::Model::Function)
986
+ expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
987
+ expect(x.variables).to be_instance_of(Array)
988
+ expect(x.variables.count).to eq(2)
989
+ expect(x.variables[0]).to be_instance_of(Expressir::Model::Variable)
990
+ expect(x.variables[0].id).to eq("test")
991
+ expect(x.variables[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
992
+ expect(x.variables[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
993
+ expect(x.variables[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
994
+ expect(x.variables[1]).to be_instance_of(Expressir::Model::Variable)
995
+ expect(x.variables[1].id).to eq("test2")
996
+ expect(x.variables[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
997
+ expect(x.variables[1].expression).to be_instance_of(Expressir::Model::Literals::Logical)
998
+ expect(x.variables[1].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
999
+ expect(x.statements).to be_instance_of(Array)
1000
+ expect(x.statements.count).to eq(1)
1001
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1002
+ end
1003
+
1004
+ # procedures
1005
+ procedures.find{|x| x.id == "empty_procedure"}.tap do |x|
1006
+ expect(x).to be_instance_of(Expressir::Model::Procedure)
1007
+ end
1008
+
1009
+ procedures.find{|x| x.id == "parameter_procedure"}.tap do |x|
1010
+ expect(x).to be_instance_of(Expressir::Model::Procedure)
1011
+ expect(x.parameters).to be_instance_of(Array)
1012
+ expect(x.parameters.count).to eq(1)
1013
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Parameter)
1014
+ expect(x.parameters[0].id).to eq("test")
1015
+ expect(x.parameters[0].var).not_to eq(true)
1016
+ expect(x.parameters[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1017
+ end
1018
+
1019
+ procedures.find{|x| x.id == "multiple_parameter_procedure"}.tap do |x|
1020
+ expect(x).to be_instance_of(Expressir::Model::Procedure)
1021
+ expect(x.parameters).to be_instance_of(Array)
1022
+ expect(x.parameters.count).to eq(2)
1023
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Parameter)
1024
+ expect(x.parameters[0].id).to eq("test")
1025
+ expect(x.parameters[0].var).not_to eq(true)
1026
+ expect(x.parameters[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1027
+ expect(x.parameters[1]).to be_instance_of(Expressir::Model::Parameter)
1028
+ expect(x.parameters[1].id).to eq("test2")
1029
+ expect(x.parameters[1].var).not_to eq(true)
1030
+ expect(x.parameters[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
1031
+ end
1032
+
1033
+ procedures.find{|x| x.id == "multiple_shorthand_parameter_procedure"}.tap do |x|
1034
+ expect(x).to be_instance_of(Expressir::Model::Procedure)
1035
+ expect(x.parameters).to be_instance_of(Array)
1036
+ expect(x.parameters.count).to eq(2)
1037
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Parameter)
1038
+ expect(x.parameters[0].id).to eq("test")
1039
+ expect(x.parameters[0].var).not_to eq(true)
1040
+ expect(x.parameters[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1041
+ expect(x.parameters[1]).to be_instance_of(Expressir::Model::Parameter)
1042
+ expect(x.parameters[1].id).to eq("test2")
1043
+ expect(x.parameters[1].var).not_to eq(true)
1044
+ expect(x.parameters[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
1045
+ end
1046
+
1047
+ procedures.find{|x| x.id == "variable_parameter_procedure"}.tap do |x|
1048
+ expect(x).to be_instance_of(Expressir::Model::Procedure)
1049
+ expect(x.parameters).to be_instance_of(Array)
1050
+ expect(x.parameters.count).to eq(1)
1051
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Parameter)
1052
+ expect(x.parameters[0].id).to eq("test")
1053
+ expect(x.parameters[0].var).to eq(true)
1054
+ expect(x.parameters[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1055
+ end
1056
+
1057
+ procedures.find{|x| x.id == "multiple_variable_parameter_procedure"}.tap do |x|
1058
+ expect(x).to be_instance_of(Expressir::Model::Procedure)
1059
+ expect(x.parameters).to be_instance_of(Array)
1060
+ expect(x.parameters.count).to eq(2)
1061
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Parameter)
1062
+ expect(x.parameters[0].id).to eq("test")
1063
+ expect(x.parameters[0].var).to eq(true)
1064
+ expect(x.parameters[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1065
+ expect(x.parameters[1]).to be_instance_of(Expressir::Model::Parameter)
1066
+ expect(x.parameters[1].id).to eq("test2")
1067
+ expect(x.parameters[1].var).not_to eq(true)
1068
+ expect(x.parameters[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
1069
+ end
1070
+
1071
+ procedures.find{|x| x.id == "multiple_variable_parameter2_procedure"}.tap do |x|
1072
+ expect(x).to be_instance_of(Expressir::Model::Procedure)
1073
+ expect(x.parameters).to be_instance_of(Array)
1074
+ expect(x.parameters.count).to eq(2)
1075
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Parameter)
1076
+ expect(x.parameters[0].id).to eq("test")
1077
+ expect(x.parameters[0].var).not_to eq(true)
1078
+ expect(x.parameters[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1079
+ expect(x.parameters[1]).to be_instance_of(Expressir::Model::Parameter)
1080
+ expect(x.parameters[1].id).to eq("test2")
1081
+ expect(x.parameters[1].var).to eq(true)
1082
+ expect(x.parameters[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
1083
+ end
1084
+
1085
+ procedures.find{|x| x.id == "multiple_shorthand_variable_parameter_procedure"}.tap do |x|
1086
+ expect(x).to be_instance_of(Expressir::Model::Procedure)
1087
+ expect(x.parameters).to be_instance_of(Array)
1088
+ expect(x.parameters.count).to eq(2)
1089
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Parameter)
1090
+ expect(x.parameters[0].id).to eq("test")
1091
+ expect(x.parameters[0].var).to eq(true)
1092
+ expect(x.parameters[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1093
+ expect(x.parameters[1]).to be_instance_of(Expressir::Model::Parameter)
1094
+ expect(x.parameters[1].id).to eq("test2")
1095
+ expect(x.parameters[1].var).to eq(true)
1096
+ expect(x.parameters[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
1097
+ end
1098
+
1099
+ procedures.find{|x| x.id == "type_procedure"}.tap do |x|
1100
+ expect(x).to be_instance_of(Expressir::Model::Procedure)
1101
+ expect(x.declarations).to be_instance_of(Array)
1102
+ expect(x.declarations.count).to eq(1)
1103
+ expect(x.declarations[0]).to be_instance_of(Expressir::Model::Type)
1104
+ expect(x.declarations[0].id).to eq("test")
1105
+ expect(x.declarations[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1106
+ end
1107
+
1108
+ procedures.find{|x| x.id == "constant_procedure"}.tap do |x|
1109
+ expect(x).to be_instance_of(Expressir::Model::Procedure)
1110
+ expect(x.constants).to be_instance_of(Array)
1111
+ expect(x.constants.count).to eq(1)
1112
+ expect(x.constants[0]).to be_instance_of(Expressir::Model::Constant)
1113
+ expect(x.constants[0].id).to eq("test")
1114
+ expect(x.constants[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1115
+ expect(x.constants[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1116
+ expect(x.constants[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1117
+ end
1118
+
1119
+ procedures.find{|x| x.id == "multiple_constant_procedure"}.tap do |x|
1120
+ expect(x).to be_instance_of(Expressir::Model::Procedure)
1121
+ expect(x.constants).to be_instance_of(Array)
1122
+ expect(x.constants.count).to eq(2)
1123
+ expect(x.constants[0]).to be_instance_of(Expressir::Model::Constant)
1124
+ expect(x.constants[0].id).to eq("test")
1125
+ expect(x.constants[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1126
+ expect(x.constants[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1127
+ expect(x.constants[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1128
+ expect(x.constants[1]).to be_instance_of(Expressir::Model::Constant)
1129
+ expect(x.constants[1].id).to eq("test2")
1130
+ expect(x.constants[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
1131
+ expect(x.constants[1].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1132
+ expect(x.constants[1].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1133
+ end
1134
+
1135
+ procedures.find{|x| x.id == "variable_procedure"}.tap do |x|
1136
+ expect(x).to be_instance_of(Expressir::Model::Procedure)
1137
+ expect(x.variables).to be_instance_of(Array)
1138
+ expect(x.variables.count).to eq(1)
1139
+ expect(x.variables[0]).to be_instance_of(Expressir::Model::Variable)
1140
+ expect(x.variables[0].id).to eq("test")
1141
+ expect(x.variables[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1142
+ end
1143
+
1144
+ procedures.find{|x| x.id == "multiple_variable_procedure"}.tap do |x|
1145
+ expect(x).to be_instance_of(Expressir::Model::Procedure)
1146
+ expect(x.variables).to be_instance_of(Array)
1147
+ expect(x.variables.count).to eq(2)
1148
+ expect(x.variables[0]).to be_instance_of(Expressir::Model::Variable)
1149
+ expect(x.variables[0].id).to eq("test")
1150
+ expect(x.variables[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1151
+ expect(x.variables[1]).to be_instance_of(Expressir::Model::Variable)
1152
+ expect(x.variables[1].id).to eq("test2")
1153
+ expect(x.variables[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
1154
+ end
1155
+
1156
+ procedures.find{|x| x.id == "multiple_shorthand_variable_procedure"}.tap do |x|
1157
+ expect(x).to be_instance_of(Expressir::Model::Procedure)
1158
+ expect(x.variables).to be_instance_of(Array)
1159
+ expect(x.variables.count).to eq(2)
1160
+ expect(x.variables[0]).to be_instance_of(Expressir::Model::Variable)
1161
+ expect(x.variables[0].id).to eq("test")
1162
+ expect(x.variables[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1163
+ expect(x.variables[1]).to be_instance_of(Expressir::Model::Variable)
1164
+ expect(x.variables[1].id).to eq("test2")
1165
+ expect(x.variables[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
1166
+ end
1167
+
1168
+ procedures.find{|x| x.id == "variable_expression_procedure"}.tap do |x|
1169
+ expect(x).to be_instance_of(Expressir::Model::Procedure)
1170
+ expect(x.variables).to be_instance_of(Array)
1171
+ expect(x.variables.count).to eq(1)
1172
+ expect(x.variables[0]).to be_instance_of(Expressir::Model::Variable)
1173
+ expect(x.variables[0].id).to eq("test")
1174
+ expect(x.variables[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1175
+ expect(x.variables[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1176
+ expect(x.variables[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1177
+ end
1178
+
1179
+ procedures.find{|x| x.id == "multiple_variable_expression_procedure"}.tap do |x|
1180
+ expect(x).to be_instance_of(Expressir::Model::Procedure)
1181
+ expect(x.variables).to be_instance_of(Array)
1182
+ expect(x.variables.count).to eq(2)
1183
+ expect(x.variables[0]).to be_instance_of(Expressir::Model::Variable)
1184
+ expect(x.variables[0].id).to eq("test")
1185
+ expect(x.variables[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1186
+ expect(x.variables[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1187
+ expect(x.variables[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1188
+ expect(x.variables[1]).to be_instance_of(Expressir::Model::Variable)
1189
+ expect(x.variables[1].id).to eq("test2")
1190
+ expect(x.variables[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
1191
+ expect(x.variables[1].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1192
+ expect(x.variables[1].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1193
+ end
1194
+
1195
+ procedures.find{|x| x.id == "multiple_shorthand_variable_expression_procedure"}.tap do |x|
1196
+ expect(x).to be_instance_of(Expressir::Model::Procedure)
1197
+ expect(x.variables).to be_instance_of(Array)
1198
+ expect(x.variables.count).to eq(2)
1199
+ expect(x.variables[0]).to be_instance_of(Expressir::Model::Variable)
1200
+ expect(x.variables[0].id).to eq("test")
1201
+ expect(x.variables[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1202
+ expect(x.variables[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1203
+ expect(x.variables[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1204
+ expect(x.variables[1]).to be_instance_of(Expressir::Model::Variable)
1205
+ expect(x.variables[1].id).to eq("test2")
1206
+ expect(x.variables[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
1207
+ expect(x.variables[1].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1208
+ expect(x.variables[1].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1209
+ end
1210
+
1211
+ procedures.find{|x| x.id == "statement_procedure"}.tap do |x|
1212
+ expect(x).to be_instance_of(Expressir::Model::Procedure)
1213
+ expect(x.statements).to be_instance_of(Array)
1214
+ expect(x.statements.count).to eq(1)
1215
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1216
+ end
1217
+
1218
+ # rules
1219
+ rules.find{|x| x.id == "empty_rule"}.tap do |x|
1220
+ expect(x).to be_instance_of(Expressir::Model::Rule)
1221
+ expect(x.applies_to).to be_instance_of(Array)
1222
+ expect(x.applies_to.count).to eq(1)
1223
+ expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1224
+ expect(x.applies_to[0].id).to eq("empty_entity")
1225
+ expect(x.where).to be_instance_of(Array)
1226
+ expect(x.where.count).to eq(1)
1227
+ expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
1228
+ expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1229
+ expect(x.where[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1230
+ end
1231
+
1232
+ rules.find{|x| x.id == "type_rule"}.tap do |x|
1233
+ expect(x).to be_instance_of(Expressir::Model::Rule)
1234
+ expect(x.applies_to).to be_instance_of(Array)
1235
+ expect(x.applies_to.count).to eq(1)
1236
+ expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1237
+ expect(x.applies_to[0].id).to eq("empty_entity")
1238
+ expect(x.declarations).to be_instance_of(Array)
1239
+ expect(x.declarations.count).to eq(1)
1240
+ expect(x.declarations[0]).to be_instance_of(Expressir::Model::Type)
1241
+ expect(x.declarations[0].id).to eq("test")
1242
+ expect(x.declarations[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1243
+ expect(x.where).to be_instance_of(Array)
1244
+ expect(x.where.count).to eq(1)
1245
+ expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
1246
+ expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1247
+ expect(x.where[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1248
+ end
1249
+
1250
+ rules.find{|x| x.id == "constant_rule"}.tap do |x|
1251
+ expect(x).to be_instance_of(Expressir::Model::Rule)
1252
+ expect(x.applies_to).to be_instance_of(Array)
1253
+ expect(x.applies_to.count).to eq(1)
1254
+ expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1255
+ expect(x.applies_to[0].id).to eq("empty_entity")
1256
+ expect(x.constants).to be_instance_of(Array)
1257
+ expect(x.constants.count).to eq(1)
1258
+ expect(x.constants[0]).to be_instance_of(Expressir::Model::Constant)
1259
+ expect(x.constants[0].id).to eq("test")
1260
+ expect(x.constants[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1261
+ expect(x.constants[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1262
+ expect(x.constants[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1263
+ expect(x.where).to be_instance_of(Array)
1264
+ expect(x.where.count).to eq(1)
1265
+ expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
1266
+ expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1267
+ expect(x.where[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1268
+ end
1269
+
1270
+ rules.find{|x| x.id == "multiple_constant_rule"}.tap do |x|
1271
+ expect(x).to be_instance_of(Expressir::Model::Rule)
1272
+ expect(x.applies_to).to be_instance_of(Array)
1273
+ expect(x.applies_to.count).to eq(1)
1274
+ expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1275
+ expect(x.applies_to[0].id).to eq("empty_entity")
1276
+ expect(x.constants).to be_instance_of(Array)
1277
+ expect(x.constants.count).to eq(2)
1278
+ expect(x.constants[0]).to be_instance_of(Expressir::Model::Constant)
1279
+ expect(x.constants[0].id).to eq("test")
1280
+ expect(x.constants[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1281
+ expect(x.constants[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1282
+ expect(x.constants[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1283
+ expect(x.constants[1]).to be_instance_of(Expressir::Model::Constant)
1284
+ expect(x.constants[1].id).to eq("test2")
1285
+ expect(x.constants[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
1286
+ expect(x.constants[1].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1287
+ expect(x.constants[1].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1288
+ expect(x.where).to be_instance_of(Array)
1289
+ expect(x.where.count).to eq(1)
1290
+ expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
1291
+ expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1292
+ expect(x.where[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1293
+ end
1294
+
1295
+ rules.find{|x| x.id == "variable_rule"}.tap do |x|
1296
+ expect(x).to be_instance_of(Expressir::Model::Rule)
1297
+ expect(x.applies_to).to be_instance_of(Array)
1298
+ expect(x.applies_to.count).to eq(1)
1299
+ expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1300
+ expect(x.applies_to[0].id).to eq("empty_entity")
1301
+ expect(x.variables).to be_instance_of(Array)
1302
+ expect(x.variables.count).to eq(1)
1303
+ expect(x.variables[0]).to be_instance_of(Expressir::Model::Variable)
1304
+ expect(x.variables[0].id).to eq("test")
1305
+ expect(x.variables[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1306
+ expect(x.where).to be_instance_of(Array)
1307
+ expect(x.where.count).to eq(1)
1308
+ expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
1309
+ expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1310
+ expect(x.where[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1311
+ end
1312
+
1313
+ rules.find{|x| x.id == "multiple_variable_rule"}.tap do |x|
1314
+ expect(x).to be_instance_of(Expressir::Model::Rule)
1315
+ expect(x.applies_to).to be_instance_of(Array)
1316
+ expect(x.applies_to.count).to eq(1)
1317
+ expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1318
+ expect(x.applies_to[0].id).to eq("empty_entity")
1319
+ expect(x.variables).to be_instance_of(Array)
1320
+ expect(x.variables.count).to eq(2)
1321
+ expect(x.variables[0]).to be_instance_of(Expressir::Model::Variable)
1322
+ expect(x.variables[0].id).to eq("test")
1323
+ expect(x.variables[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1324
+ expect(x.variables[1]).to be_instance_of(Expressir::Model::Variable)
1325
+ expect(x.variables[1].id).to eq("test2")
1326
+ expect(x.variables[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
1327
+ expect(x.where).to be_instance_of(Array)
1328
+ expect(x.where.count).to eq(1)
1329
+ expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
1330
+ expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1331
+ expect(x.where[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1332
+ end
1333
+
1334
+ rules.find{|x| x.id == "multiple_shorthand_variable_rule"}.tap do |x|
1335
+ expect(x).to be_instance_of(Expressir::Model::Rule)
1336
+ expect(x.applies_to).to be_instance_of(Array)
1337
+ expect(x.applies_to.count).to eq(1)
1338
+ expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1339
+ expect(x.applies_to[0].id).to eq("empty_entity")
1340
+ expect(x.variables).to be_instance_of(Array)
1341
+ expect(x.variables.count).to eq(2)
1342
+ expect(x.variables[0]).to be_instance_of(Expressir::Model::Variable)
1343
+ expect(x.variables[0].id).to eq("test")
1344
+ expect(x.variables[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1345
+ expect(x.variables[1]).to be_instance_of(Expressir::Model::Variable)
1346
+ expect(x.variables[1].id).to eq("test2")
1347
+ expect(x.variables[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
1348
+ expect(x.where).to be_instance_of(Array)
1349
+ expect(x.where.count).to eq(1)
1350
+ expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
1351
+ expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1352
+ expect(x.where[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1353
+ end
1354
+
1355
+ rules.find{|x| x.id == "variable_expression_rule"}.tap do |x|
1356
+ expect(x).to be_instance_of(Expressir::Model::Rule)
1357
+ expect(x.applies_to).to be_instance_of(Array)
1358
+ expect(x.applies_to.count).to eq(1)
1359
+ expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1360
+ expect(x.applies_to[0].id).to eq("empty_entity")
1361
+ expect(x.variables).to be_instance_of(Array)
1362
+ expect(x.variables.count).to eq(1)
1363
+ expect(x.variables[0]).to be_instance_of(Expressir::Model::Variable)
1364
+ expect(x.variables[0].id).to eq("test")
1365
+ expect(x.variables[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1366
+ expect(x.variables[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1367
+ expect(x.variables[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1368
+ expect(x.where).to be_instance_of(Array)
1369
+ expect(x.where.count).to eq(1)
1370
+ expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
1371
+ expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1372
+ expect(x.where[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1373
+ end
1374
+
1375
+ rules.find{|x| x.id == "multiple_variable_expression_rule"}.tap do |x|
1376
+ expect(x).to be_instance_of(Expressir::Model::Rule)
1377
+ expect(x.applies_to).to be_instance_of(Array)
1378
+ expect(x.applies_to.count).to eq(1)
1379
+ expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1380
+ expect(x.applies_to[0].id).to eq("empty_entity")
1381
+ expect(x.variables).to be_instance_of(Array)
1382
+ expect(x.variables.count).to eq(2)
1383
+ expect(x.variables[0]).to be_instance_of(Expressir::Model::Variable)
1384
+ expect(x.variables[0].id).to eq("test")
1385
+ expect(x.variables[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1386
+ expect(x.variables[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1387
+ expect(x.variables[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1388
+ expect(x.variables[1]).to be_instance_of(Expressir::Model::Variable)
1389
+ expect(x.variables[1].id).to eq("test2")
1390
+ expect(x.variables[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
1391
+ expect(x.variables[1].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1392
+ expect(x.variables[1].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1393
+ expect(x.where).to be_instance_of(Array)
1394
+ expect(x.where.count).to eq(1)
1395
+ expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
1396
+ expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1397
+ expect(x.where[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1398
+ end
1399
+
1400
+ rules.find{|x| x.id == "multiple_shorthand_variable_expression_rule"}.tap do |x|
1401
+ expect(x).to be_instance_of(Expressir::Model::Rule)
1402
+ expect(x.applies_to).to be_instance_of(Array)
1403
+ expect(x.applies_to.count).to eq(1)
1404
+ expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1405
+ expect(x.applies_to[0].id).to eq("empty_entity")
1406
+ expect(x.variables).to be_instance_of(Array)
1407
+ expect(x.variables.count).to eq(2)
1408
+ expect(x.variables[0]).to be_instance_of(Expressir::Model::Variable)
1409
+ expect(x.variables[0].id).to eq("test")
1410
+ expect(x.variables[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1411
+ expect(x.variables[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1412
+ expect(x.variables[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1413
+ expect(x.variables[1]).to be_instance_of(Expressir::Model::Variable)
1414
+ expect(x.variables[1].id).to eq("test2")
1415
+ expect(x.variables[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
1416
+ expect(x.variables[1].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1417
+ expect(x.variables[1].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1418
+ expect(x.where).to be_instance_of(Array)
1419
+ expect(x.where.count).to eq(1)
1420
+ expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
1421
+ expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1422
+ expect(x.where[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1423
+ end
1424
+
1425
+ rules.find{|x| x.id == "statement_rule"}.tap do |x|
1426
+ expect(x).to be_instance_of(Expressir::Model::Rule)
1427
+ expect(x.applies_to).to be_instance_of(Array)
1428
+ expect(x.applies_to.count).to eq(1)
1429
+ expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1430
+ expect(x.applies_to[0].id).to eq("empty_entity")
1431
+ expect(x.statements).to be_instance_of(Array)
1432
+ expect(x.statements.count).to eq(1)
1433
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1434
+ expect(x.where).to be_instance_of(Array)
1435
+ expect(x.where.count).to eq(1)
1436
+ expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
1437
+ expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1438
+ expect(x.where[0].expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1439
+ end
1440
+
1441
+ # simple types
1442
+ types.find{|x| x.id == "binary_type"}.type.tap do |x|
1443
+ expect(x).to be_instance_of(Expressir::Model::Types::Binary)
1444
+ end
1445
+
1446
+ types.find{|x| x.id == "binary_width_type"}.type.tap do |x|
1447
+ expect(x).to be_instance_of(Expressir::Model::Types::Binary)
1448
+ expect(x.width).to be_instance_of(Expressir::Model::Literals::Integer)
1449
+ expect(x.width.value).to eq("3")
1450
+ end
1451
+
1452
+ types.find{|x| x.id == "binary_width_fixed_type"}.type.tap do |x|
1453
+ expect(x).to be_instance_of(Expressir::Model::Types::Binary)
1454
+ expect(x.width).to be_instance_of(Expressir::Model::Literals::Integer)
1455
+ expect(x.width.value).to eq("3")
1456
+ expect(x.fixed).to eq(true)
1457
+ end
1458
+
1459
+ types.find{|x| x.id == "boolean_type"}.type.tap do |x|
1460
+ expect(x).to be_instance_of(Expressir::Model::Types::Boolean)
1461
+ end
1462
+
1463
+ types.find{|x| x.id == "integer_type"}.type.tap do |x|
1464
+ expect(x).to be_instance_of(Expressir::Model::Types::Integer)
1465
+ end
1466
+
1467
+ types.find{|x| x.id == "logical_type"}.type.tap do |x|
1468
+ expect(x).to be_instance_of(Expressir::Model::Types::Logical)
1469
+ end
1470
+
1471
+ types.find{|x| x.id == "number_type"}.type.tap do |x|
1472
+ expect(x).to be_instance_of(Expressir::Model::Types::Number)
1473
+ end
1474
+
1475
+ types.find{|x| x.id == "real_type"}.type.tap do |x|
1476
+ expect(x).to be_instance_of(Expressir::Model::Types::Real)
1477
+ end
1478
+
1479
+ types.find{|x| x.id == "real_precision_type"}.type.tap do |x|
1480
+ expect(x).to be_instance_of(Expressir::Model::Types::Real)
1481
+ expect(x.precision).to be_instance_of(Expressir::Model::Literals::Integer)
1482
+ expect(x.precision.value).to eq("3")
1483
+ end
1484
+
1485
+ types.find{|x| x.id == "string_type"}.type.tap do |x|
1486
+ expect(x).to be_instance_of(Expressir::Model::Types::String)
1487
+ end
1488
+
1489
+ types.find{|x| x.id == "string_width_type"}.type.tap do |x|
1490
+ expect(x).to be_instance_of(Expressir::Model::Types::String)
1491
+ expect(x.width).to be_instance_of(Expressir::Model::Literals::Integer)
1492
+ expect(x.width.value).to eq("3")
1493
+ end
1494
+
1495
+ types.find{|x| x.id == "string_width_fixed_type"}.type.tap do |x|
1496
+ expect(x).to be_instance_of(Expressir::Model::Types::String)
1497
+ expect(x.width).to be_instance_of(Expressir::Model::Literals::Integer)
1498
+ expect(x.width.value).to eq("3")
1499
+ expect(x.fixed).to eq(true)
1500
+ end
1501
+
1502
+ # aggregation types
1503
+ types.find{|x| x.id == "array_type"}.type.tap do |x|
1504
+ expect(x).to be_instance_of(Expressir::Model::Types::Array)
1505
+ expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
1506
+ expect(x.bound1.value).to eq("1")
1507
+ expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
1508
+ expect(x.bound2.value).to eq("9")
1509
+ expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1510
+ end
1511
+
1512
+ types.find{|x| x.id == "array_optional_type"}.type.tap do |x|
1513
+ expect(x).to be_instance_of(Expressir::Model::Types::Array)
1514
+ expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
1515
+ expect(x.bound1.value).to eq("1")
1516
+ expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
1517
+ expect(x.bound2.value).to eq("9")
1518
+ expect(x.optional).to eq(true)
1519
+ expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1520
+ end
1521
+
1522
+ types.find{|x| x.id == "array_unique_type"}.type.tap do |x|
1523
+ expect(x).to be_instance_of(Expressir::Model::Types::Array)
1524
+ expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
1525
+ expect(x.bound1.value).to eq("1")
1526
+ expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
1527
+ expect(x.bound2.value).to eq("9")
1528
+ expect(x.unique).to eq(true)
1529
+ expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1530
+ end
1531
+
1532
+ types.find{|x| x.id == "array_optional_unique_type"}.type.tap do |x|
1533
+ expect(x).to be_instance_of(Expressir::Model::Types::Array)
1534
+ expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
1535
+ expect(x.bound1.value).to eq("1")
1536
+ expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
1537
+ expect(x.bound2.value).to eq("9")
1538
+ expect(x.optional).to eq(true)
1539
+ expect(x.unique).to eq(true)
1540
+ expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1541
+ end
1542
+
1543
+ types.find{|x| x.id == "bag_type"}.type.tap do |x|
1544
+ expect(x).to be_instance_of(Expressir::Model::Types::Bag)
1545
+ expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1546
+ end
1547
+
1548
+ types.find{|x| x.id == "bag_bound_type"}.type.tap do |x|
1549
+ expect(x).to be_instance_of(Expressir::Model::Types::Bag)
1550
+ expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
1551
+ expect(x.bound1.value).to eq("1")
1552
+ expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
1553
+ expect(x.bound2.value).to eq("9")
1554
+ expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1555
+ end
1556
+
1557
+ types.find{|x| x.id == "list_type"}.type.tap do |x|
1558
+ expect(x).to be_instance_of(Expressir::Model::Types::List)
1559
+ expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1560
+ end
1561
+
1562
+ types.find{|x| x.id == "list_bound_type"}.type.tap do |x|
1563
+ expect(x).to be_instance_of(Expressir::Model::Types::List)
1564
+ expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
1565
+ expect(x.bound1.value).to eq("1")
1566
+ expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
1567
+ expect(x.bound2.value).to eq("9")
1568
+ expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1569
+ end
1570
+
1571
+ types.find{|x| x.id == "list_unique_type"}.type.tap do |x|
1572
+ expect(x).to be_instance_of(Expressir::Model::Types::List)
1573
+ expect(x.unique).to eq(true)
1574
+ expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1575
+ end
1576
+
1577
+ types.find{|x| x.id == "list_bound_unique_type"}.type.tap do |x|
1578
+ expect(x).to be_instance_of(Expressir::Model::Types::List)
1579
+ expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
1580
+ expect(x.bound1.value).to eq("1")
1581
+ expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
1582
+ expect(x.bound2.value).to eq("9")
1583
+ expect(x.unique).to eq(true)
1584
+ expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1585
+ end
1586
+
1587
+ types.find{|x| x.id == "set_type"}.type.tap do |x|
1588
+ expect(x).to be_instance_of(Expressir::Model::Types::Set)
1589
+ expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1590
+ end
1591
+
1592
+ types.find{|x| x.id == "set_bound_type"}.type.tap do |x|
1593
+ expect(x).to be_instance_of(Expressir::Model::Types::Set)
1594
+ expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
1595
+ expect(x.bound1.value).to eq("1")
1596
+ expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
1597
+ expect(x.bound2.value).to eq("9")
1598
+ expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1599
+ end
1600
+
1601
+ # constructed types
1602
+ types.find{|x| x.id == "select_type"}.type.tap do |x|
1603
+ expect(x).to be_instance_of(Expressir::Model::Types::Select)
1604
+ end
1605
+
1606
+ types.find{|x| x.id == "select_extensible_type"}.type.tap do |x|
1607
+ expect(x).to be_instance_of(Expressir::Model::Types::Select)
1608
+ expect(x.extensible).to eq(true)
1609
+ end
1610
+
1611
+ types.find{|x| x.id == "select_extensible_generic_entity_type"}.type.tap do |x|
1612
+ expect(x).to be_instance_of(Expressir::Model::Types::Select)
1613
+ expect(x.extensible).to eq(true)
1614
+ expect(x.generic_entity).to eq(true)
1615
+ end
1616
+
1617
+ types.find{|x| x.id == "select_list_type"}.type.tap do |x|
1618
+ expect(x).to be_instance_of(Expressir::Model::Types::Select)
1619
+ expect(x.items).to be_instance_of(Array)
1620
+ expect(x.items.count).to eq(1)
1621
+ expect(x.items[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1622
+ expect(x.items[0].id).to eq("empty_type")
1623
+ end
1624
+
1625
+ types.find{|x| x.id == "select_extension_type_ref_type"}.type.tap do |x|
1626
+ expect(x).to be_instance_of(Expressir::Model::Types::Select)
1627
+ expect(x.extension_type).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1628
+ expect(x.extension_type.id).to eq("select_type")
1629
+ end
1630
+
1631
+ types.find{|x| x.id == "select_extension_type_ref_list_type"}.type.tap do |x|
1632
+ expect(x).to be_instance_of(Expressir::Model::Types::Select)
1633
+ expect(x.extension_type).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1634
+ expect(x.extension_type.id).to eq("select_type")
1635
+ expect(x.extension_items).to be_instance_of(Array)
1636
+ expect(x.extension_items.count).to eq(1)
1637
+ expect(x.extension_items[0]).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1638
+ expect(x.extension_items[0].id).to eq("empty_type")
1639
+ end
1640
+
1641
+ types.find{|x| x.id == "enumeration_type"}.type.tap do |x|
1642
+ expect(x).to be_instance_of(Expressir::Model::Types::Enumeration)
1643
+ end
1644
+
1645
+ types.find{|x| x.id == "enumeration_extensible_type"}.type.tap do |x|
1646
+ expect(x).to be_instance_of(Expressir::Model::Types::Enumeration)
1647
+ expect(x.extensible).to eq(true)
1648
+ end
1649
+
1650
+ types.find{|x| x.id == "enumeration_list_type"}.type.tap do |x|
1651
+ expect(x).to be_instance_of(Expressir::Model::Types::Enumeration)
1652
+ expect(x.items).to be_instance_of(Array)
1653
+ expect(x.items.count).to eq(1)
1654
+ expect(x.items[0]).to be_instance_of(Expressir::Model::EnumerationItem)
1655
+ expect(x.items[0].id).to eq("test")
1656
+ end
1657
+
1658
+ types.find{|x| x.id == "enumeration_extension_type_ref_type"}.type.tap do |x|
1659
+ expect(x).to be_instance_of(Expressir::Model::Types::Enumeration)
1660
+ expect(x.extension_type).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1661
+ expect(x.extension_type.id).to eq("enumeration_type")
1662
+ end
1663
+
1664
+ types.find{|x| x.id == "enumeration_extension_type_ref_list_type"}.type.tap do |x|
1665
+ expect(x).to be_instance_of(Expressir::Model::Types::Enumeration)
1666
+ expect(x.extension_type).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1667
+ expect(x.extension_type.id).to eq("enumeration_type")
1668
+ expect(x.extension_items).to be_instance_of(Array)
1669
+ expect(x.extension_items[0]).to be_instance_of(Expressir::Model::EnumerationItem)
1670
+ expect(x.extension_items[0].id).to eq("test")
1671
+ end
1672
+
1673
+ # statements
1674
+ functions.find{|x| x.id == "alias_simple_reference_statement"}.statements[0].tap do |x|
1675
+ expect(x).to be_instance_of(Expressir::Model::Statements::Alias)
1676
+ expect(x.id).to eq("test")
1677
+ expect(x.expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1678
+ expect(x.expression.id).to eq("test")
1679
+ expect(x.statements).to be_instance_of(Array)
1680
+ expect(x.statements.count).to eq(1)
1681
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1682
+ end
1683
+
1684
+ functions.find{|x| x.id == "alias_attribute_reference_statement"}.statements[0].tap do |x|
1685
+ expect(x).to be_instance_of(Expressir::Model::Statements::Alias)
1686
+ expect(x.id).to eq("test")
1687
+ expect(x.expression).to be_instance_of(Expressir::Model::Expressions::AttributeReference)
1688
+ expect(x.expression.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1689
+ expect(x.expression.ref.id).to eq("test")
1690
+ expect(x.expression.attribute).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1691
+ expect(x.expression.attribute.id).to eq("test")
1692
+ expect(x.statements).to be_instance_of(Array)
1693
+ expect(x.statements.count).to eq(1)
1694
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1695
+ end
1696
+
1697
+ functions.find{|x| x.id == "alias_group_reference_statement"}.statements[0].tap do |x|
1698
+ expect(x).to be_instance_of(Expressir::Model::Statements::Alias)
1699
+ expect(x.id).to eq("test")
1700
+ expect(x.expression).to be_instance_of(Expressir::Model::Expressions::GroupReference)
1701
+ expect(x.expression.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1702
+ expect(x.expression.ref.id).to eq("test")
1703
+ expect(x.expression.entity).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1704
+ expect(x.expression.entity.id).to eq("test")
1705
+ expect(x.statements).to be_instance_of(Array)
1706
+ expect(x.statements.count).to eq(1)
1707
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1708
+ end
1709
+
1710
+ functions.find{|x| x.id == "alias_index_reference_statement"}.statements[0].tap do |x|
1711
+ expect(x).to be_instance_of(Expressir::Model::Statements::Alias)
1712
+ expect(x.id).to eq("test")
1713
+ expect(x.expression).to be_instance_of(Expressir::Model::Expressions::IndexReference)
1714
+ expect(x.expression.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1715
+ expect(x.expression.ref.id).to eq("test")
1716
+ expect(x.expression.index1).to be_instance_of(Expressir::Model::Literals::Integer)
1717
+ expect(x.expression.index1.value).to eq("1")
1718
+ expect(x.statements).to be_instance_of(Array)
1719
+ expect(x.statements.count).to eq(1)
1720
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1721
+ end
1722
+
1723
+ functions.find{|x| x.id == "alias_index2_reference_statement"}.statements[0].tap do |x|
1724
+ expect(x).to be_instance_of(Expressir::Model::Statements::Alias)
1725
+ expect(x.id).to eq("test")
1726
+ expect(x.expression).to be_instance_of(Expressir::Model::Expressions::IndexReference)
1727
+ expect(x.expression.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1728
+ expect(x.expression.ref.id).to eq("test")
1729
+ expect(x.expression.index1).to be_instance_of(Expressir::Model::Literals::Integer)
1730
+ expect(x.expression.index1.value).to eq("1")
1731
+ expect(x.expression.index2).to be_instance_of(Expressir::Model::Literals::Integer)
1732
+ expect(x.expression.index2.value).to eq("9")
1733
+ expect(x.statements).to be_instance_of(Array)
1734
+ expect(x.statements.count).to eq(1)
1735
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1736
+ end
1737
+
1738
+ functions.find{|x| x.id == "assignment_simple_reference_statement"}.statements[0].tap do |x|
1739
+ expect(x).to be_instance_of(Expressir::Model::Statements::Assignment)
1740
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1741
+ expect(x.ref.id).to eq("test")
1742
+ expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
1743
+ expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1744
+ end
1745
+
1746
+ functions.find{|x| x.id == "assignment_attribute_reference_statement"}.statements[0].tap do |x|
1747
+ expect(x).to be_instance_of(Expressir::Model::Statements::Assignment)
1748
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::AttributeReference)
1749
+ expect(x.ref.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1750
+ expect(x.ref.ref.id).to eq("test")
1751
+ expect(x.ref.attribute).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1752
+ expect(x.ref.attribute.id).to eq("test")
1753
+ expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
1754
+ expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1755
+ end
1756
+
1757
+ functions.find{|x| x.id == "assignment_group_reference_statement"}.statements[0].tap do |x|
1758
+ expect(x).to be_instance_of(Expressir::Model::Statements::Assignment)
1759
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::GroupReference)
1760
+ expect(x.ref.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1761
+ expect(x.ref.ref.id).to eq("test")
1762
+ expect(x.ref.entity).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1763
+ expect(x.ref.entity.id).to eq("test")
1764
+ expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
1765
+ expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1766
+ end
1767
+
1768
+ functions.find{|x| x.id == "assignment_index_reference_statement"}.statements[0].tap do |x|
1769
+ expect(x).to be_instance_of(Expressir::Model::Statements::Assignment)
1770
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::IndexReference)
1771
+ expect(x.ref.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1772
+ expect(x.ref.ref.id).to eq("test")
1773
+ expect(x.ref.index1).to be_instance_of(Expressir::Model::Literals::Integer)
1774
+ expect(x.ref.index1.value).to eq("1")
1775
+ expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
1776
+ expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1777
+ end
1778
+
1779
+ functions.find{|x| x.id == "assignment_index2_reference_statement"}.statements[0].tap do |x|
1780
+ expect(x).to be_instance_of(Expressir::Model::Statements::Assignment)
1781
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::IndexReference)
1782
+ expect(x.ref.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1783
+ expect(x.ref.ref.id).to eq("test")
1784
+ expect(x.ref.index1).to be_instance_of(Expressir::Model::Literals::Integer)
1785
+ expect(x.ref.index1.value).to eq("1")
1786
+ expect(x.ref.index2).to be_instance_of(Expressir::Model::Literals::Integer)
1787
+ expect(x.ref.index2.value).to eq("9")
1788
+ expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
1789
+ expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1790
+ end
1791
+
1792
+ functions.find{|x| x.id == "case_statement"}.statements[0].tap do |x|
1793
+ expect(x).to be_instance_of(Expressir::Model::Statements::Case)
1794
+ expect(x.expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1795
+ expect(x.expression.id).to eq("test")
1796
+ expect(x.actions).to be_instance_of(Array)
1797
+ expect(x.actions.count).to eq(1)
1798
+ expect(x.actions[0]).to be_instance_of(Expressir::Model::Statements::CaseAction)
1799
+ expect(x.actions[0].labels).to be_instance_of(Array)
1800
+ expect(x.actions[0].labels.count).to eq(1)
1801
+ expect(x.actions[0].labels[0]).to be_instance_of(Expressir::Model::Literals::Logical)
1802
+ expect(x.actions[0].labels[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
1803
+ expect(x.actions[0].statement).to be_instance_of(Expressir::Model::Statements::Null)
1804
+ end
1805
+
1806
+ functions.find{|x| x.id == "case_multiple_statement"}.statements[0].tap do |x|
1807
+ expect(x).to be_instance_of(Expressir::Model::Statements::Case)
1808
+ expect(x.expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1809
+ expect(x.expression.id).to eq("test")
1810
+ expect(x.actions).to be_instance_of(Array)
1811
+ expect(x.actions.count).to eq(2)
1812
+ expect(x.actions[0]).to be_instance_of(Expressir::Model::Statements::CaseAction)
1813
+ expect(x.actions[0].labels).to be_instance_of(Array)
1814
+ expect(x.actions[0].labels.count).to eq(1)
1815
+ expect(x.actions[0].labels[0]).to be_instance_of(Expressir::Model::Literals::Logical)
1816
+ expect(x.actions[0].labels[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
1817
+ expect(x.actions[0].statement).to be_instance_of(Expressir::Model::Statements::Null)
1818
+ expect(x.actions[1]).to be_instance_of(Expressir::Model::Statements::CaseAction)
1819
+ expect(x.actions[1].labels).to be_instance_of(Array)
1820
+ expect(x.actions[1].labels.count).to eq(1)
1821
+ expect(x.actions[1].labels[0]).to be_instance_of(Expressir::Model::Literals::Logical)
1822
+ expect(x.actions[1].labels[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
1823
+ expect(x.actions[1].statement).to be_instance_of(Expressir::Model::Statements::Null)
1824
+ end
1825
+
1826
+ functions.find{|x| x.id == "case_multiple_shorthand_statement"}.statements[0].tap do |x|
1827
+ expect(x).to be_instance_of(Expressir::Model::Statements::Case)
1828
+ expect(x.expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1829
+ expect(x.expression.id).to eq("test")
1830
+ expect(x.actions).to be_instance_of(Array)
1831
+ expect(x.actions.count).to eq(1)
1832
+ expect(x.actions[0]).to be_instance_of(Expressir::Model::Statements::CaseAction)
1833
+ expect(x.actions[0].labels).to be_instance_of(Array)
1834
+ expect(x.actions[0].labels.count).to eq(2)
1835
+ expect(x.actions[0].labels[0]).to be_instance_of(Expressir::Model::Literals::Logical)
1836
+ expect(x.actions[0].labels[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
1837
+ expect(x.actions[0].labels[1]).to be_instance_of(Expressir::Model::Literals::Logical)
1838
+ expect(x.actions[0].labels[1].value).to eq(Expressir::Model::Literals::Logical::TRUE)
1839
+ expect(x.actions[0].statement).to be_instance_of(Expressir::Model::Statements::Null)
1840
+ end
1841
+
1842
+ functions.find{|x| x.id == "case_otherwise_statement"}.statements[0].tap do |x|
1843
+ expect(x).to be_instance_of(Expressir::Model::Statements::Case)
1844
+ expect(x.expression).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1845
+ expect(x.expression.id).to eq("test")
1846
+ expect(x.actions).to be_instance_of(Array)
1847
+ expect(x.actions.count).to eq(1)
1848
+ expect(x.actions[0]).to be_instance_of(Expressir::Model::Statements::CaseAction)
1849
+ expect(x.actions[0].labels).to be_instance_of(Array)
1850
+ expect(x.actions[0].labels.count).to eq(1)
1851
+ expect(x.actions[0].labels[0]).to be_instance_of(Expressir::Model::Literals::Logical)
1852
+ expect(x.actions[0].labels[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
1853
+ expect(x.actions[0].statement).to be_instance_of(Expressir::Model::Statements::Null)
1854
+ expect(x.otherwise_statement).to be_instance_of(Expressir::Model::Statements::Null)
1855
+ end
1856
+
1857
+ functions.find{|x| x.id == "compound_statement"}.statements[0].tap do |x|
1858
+ expect(x).to be_instance_of(Expressir::Model::Statements::Compound)
1859
+ expect(x.statements).to be_instance_of(Array)
1860
+ expect(x.statements.count).to eq(1)
1861
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1862
+ end
1863
+
1864
+ functions.find{|x| x.id == "escape_statement"}.statements[0].tap do |x|
1865
+ expect(x).to be_instance_of(Expressir::Model::Statements::Escape)
1866
+ end
1867
+
1868
+ functions.find{|x| x.id == "if_statement"}.statements[0].tap do |x|
1869
+ expect(x).to be_instance_of(Expressir::Model::Statements::If)
1870
+ expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
1871
+ expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1872
+ expect(x.statements).to be_instance_of(Array)
1873
+ expect(x.statements.count).to eq(1)
1874
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1875
+ end
1876
+
1877
+ functions.find{|x| x.id == "if2_statement"}.statements[0].tap do |x|
1878
+ expect(x).to be_instance_of(Expressir::Model::Statements::If)
1879
+ expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
1880
+ expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1881
+ expect(x.statements).to be_instance_of(Array)
1882
+ expect(x.statements.count).to eq(2)
1883
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1884
+ expect(x.statements[1]).to be_instance_of(Expressir::Model::Statements::Null)
1885
+ end
1886
+
1887
+ functions.find{|x| x.id == "if_else_statement"}.statements[0].tap do |x|
1888
+ expect(x).to be_instance_of(Expressir::Model::Statements::If)
1889
+ expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
1890
+ expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1891
+ expect(x.statements).to be_instance_of(Array)
1892
+ expect(x.statements.count).to eq(1)
1893
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1894
+ expect(x.else_statements).to be_instance_of(Array)
1895
+ expect(x.else_statements.count).to eq(1)
1896
+ expect(x.else_statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1897
+ end
1898
+
1899
+ functions.find{|x| x.id == "if2_else_statement"}.statements[0].tap do |x|
1900
+ expect(x).to be_instance_of(Expressir::Model::Statements::If)
1901
+ expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
1902
+ expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1903
+ expect(x.statements).to be_instance_of(Array)
1904
+ expect(x.statements.count).to eq(2)
1905
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1906
+ expect(x.statements[1]).to be_instance_of(Expressir::Model::Statements::Null)
1907
+ expect(x.else_statements).to be_instance_of(Array)
1908
+ expect(x.else_statements.count).to eq(1)
1909
+ expect(x.else_statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1910
+ end
1911
+
1912
+ functions.find{|x| x.id == "if_else2_statement"}.statements[0].tap do |x|
1913
+ expect(x).to be_instance_of(Expressir::Model::Statements::If)
1914
+ expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
1915
+ expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1916
+ expect(x.statements).to be_instance_of(Array)
1917
+ expect(x.statements.count).to eq(1)
1918
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1919
+ expect(x.else_statements).to be_instance_of(Array)
1920
+ expect(x.else_statements.count).to eq(2)
1921
+ expect(x.else_statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1922
+ expect(x.else_statements[1]).to be_instance_of(Expressir::Model::Statements::Null)
1923
+ end
1924
+
1925
+ functions.find{|x| x.id == "if2_else2_statement"}.statements[0].tap do |x|
1926
+ expect(x).to be_instance_of(Expressir::Model::Statements::If)
1927
+ expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
1928
+ expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
1929
+ expect(x.statements).to be_instance_of(Array)
1930
+ expect(x.statements.count).to eq(2)
1931
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1932
+ expect(x.statements[1]).to be_instance_of(Expressir::Model::Statements::Null)
1933
+ expect(x.else_statements).to be_instance_of(Array)
1934
+ expect(x.else_statements.count).to eq(2)
1935
+ expect(x.else_statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1936
+ expect(x.else_statements[1]).to be_instance_of(Expressir::Model::Statements::Null)
1937
+ end
1938
+
1939
+ functions.find{|x| x.id == "null_statement"}.statements[0].tap do |x|
1940
+ expect(x).to be_instance_of(Expressir::Model::Statements::Null)
1941
+ end
1942
+
1943
+ functions.find{|x| x.id == "call_statement"}.statements[0].tap do |x|
1944
+ expect(x).to be_instance_of(Expressir::Model::Statements::Call)
1945
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1946
+ expect(x.ref.id).to eq("empty_procedure")
1947
+ end
1948
+
1949
+ functions.find{|x| x.id == "call_parameter_statement"}.statements[0].tap do |x|
1950
+ expect(x).to be_instance_of(Expressir::Model::Statements::Call)
1951
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1952
+ expect(x.ref.id).to eq("empty_procedure")
1953
+ expect(x.parameters).to be_instance_of(Array)
1954
+ expect(x.parameters.count).to eq(1)
1955
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
1956
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
1957
+ end
1958
+
1959
+ functions.find{|x| x.id == "call_parameter2_statement"}.statements[0].tap do |x|
1960
+ expect(x).to be_instance_of(Expressir::Model::Statements::Call)
1961
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1962
+ expect(x.ref.id).to eq("empty_procedure")
1963
+ expect(x.parameters).to be_instance_of(Array)
1964
+ expect(x.parameters.count).to eq(2)
1965
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
1966
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
1967
+ expect(x.parameters[1]).to be_instance_of(Expressir::Model::Literals::Logical)
1968
+ expect(x.parameters[1].value).to eq(Expressir::Model::Literals::Logical::TRUE)
1969
+ end
1970
+
1971
+ functions.find{|x| x.id == "call_insert_statement"}.statements[0].tap do |x|
1972
+ expect(x).to be_instance_of(Expressir::Model::Statements::Call)
1973
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1974
+ expect(x.ref.id).to eq("INSERT")
1975
+ expect(x.parameters).to be_instance_of(Array)
1976
+ expect(x.parameters.count).to eq(1)
1977
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
1978
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
1979
+ end
1980
+
1981
+ functions.find{|x| x.id == "call_remove_statement"}.statements[0].tap do |x|
1982
+ expect(x).to be_instance_of(Expressir::Model::Statements::Call)
1983
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
1984
+ expect(x.ref.id).to eq("REMOVE")
1985
+ expect(x.parameters).to be_instance_of(Array)
1986
+ expect(x.parameters.count).to eq(1)
1987
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
1988
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
1989
+ end
1990
+
1991
+ functions.find{|x| x.id == "repeat_statement"}.statements[0].tap do |x|
1992
+ expect(x).to be_instance_of(Expressir::Model::Statements::Repeat)
1993
+ expect(x.statements).to be_instance_of(Array)
1994
+ expect(x.statements.count).to eq(1)
1995
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1996
+ end
1997
+
1998
+ functions.find{|x| x.id == "repeat_variable_statement"}.statements[0].tap do |x|
1999
+ expect(x).to be_instance_of(Expressir::Model::Statements::Repeat)
2000
+ expect(x.id).to eq("test")
2001
+ expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
2002
+ expect(x.bound1.value).to eq("1")
2003
+ expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
2004
+ expect(x.bound2.value).to eq("9")
2005
+ expect(x.statements).to be_instance_of(Array)
2006
+ expect(x.statements.count).to eq(1)
2007
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2008
+ end
2009
+
2010
+ functions.find{|x| x.id == "repeat_variable_increment_statement"}.statements[0].tap do |x|
2011
+ expect(x).to be_instance_of(Expressir::Model::Statements::Repeat)
2012
+ expect(x.id).to eq("test")
2013
+ expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
2014
+ expect(x.bound1.value).to eq("1")
2015
+ expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
2016
+ expect(x.bound2.value).to eq("9")
2017
+ expect(x.increment).to be_instance_of(Expressir::Model::Literals::Integer)
2018
+ expect(x.increment.value).to eq("2")
2019
+ expect(x.statements).to be_instance_of(Array)
2020
+ expect(x.statements.count).to eq(1)
2021
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2022
+ end
2023
+
2024
+ functions.find{|x| x.id == "repeat_while_statement"}.statements[0].tap do |x|
2025
+ expect(x).to be_instance_of(Expressir::Model::Statements::Repeat)
2026
+ expect(x.while_expression).to be_instance_of(Expressir::Model::Literals::Logical)
2027
+ expect(x.while_expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2028
+ expect(x.statements).to be_instance_of(Array)
2029
+ expect(x.statements.count).to eq(1)
2030
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2031
+ end
2032
+
2033
+ functions.find{|x| x.id == "repeat_until_statement"}.statements[0].tap do |x|
2034
+ expect(x).to be_instance_of(Expressir::Model::Statements::Repeat)
2035
+ expect(x.until_expression).to be_instance_of(Expressir::Model::Literals::Logical)
2036
+ expect(x.until_expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2037
+ expect(x.statements).to be_instance_of(Array)
2038
+ expect(x.statements.count).to eq(1)
2039
+ expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2040
+ end
2041
+
2042
+ functions.find{|x| x.id == "return_statement"}.statements[0].tap do |x|
2043
+ expect(x).to be_instance_of(Expressir::Model::Statements::Return)
2044
+ end
2045
+
2046
+ functions.find{|x| x.id == "return_expression_statement"}.statements[0].tap do |x|
2047
+ expect(x).to be_instance_of(Expressir::Model::Statements::Return)
2048
+ expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
2049
+ expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2050
+ end
2051
+
2052
+ functions.find{|x| x.id == "skip_statement"}.statements[0].tap do |x|
2053
+ expect(x).to be_instance_of(Expressir::Model::Statements::Skip)
2054
+ end
2055
+
2056
+ # literal expressions
2057
+ functions.find{|x| x.id == "binary_expression"}.statements[0].expression.tap do |x|
2058
+ expect(x).to be_instance_of(Expressir::Model::Literals::Binary)
2059
+ expect(x.value).to eq("011110000111100001111000")
2060
+ end
2061
+
2062
+ functions.find{|x| x.id == "integer_expression"}.statements[0].expression.tap do |x|
2063
+ expect(x).to be_instance_of(Expressir::Model::Literals::Integer)
2064
+ expect(x.value).to eq("999")
2065
+ end
2066
+
2067
+ functions.find{|x| x.id == "true_logical_expression"}.statements[0].expression.tap do |x|
2068
+ expect(x).to be_instance_of(Expressir::Model::Literals::Logical)
2069
+ expect(x.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2070
+ end
2071
+
2072
+ functions.find{|x| x.id == "false_logical_expression"}.statements[0].expression.tap do |x|
2073
+ expect(x).to be_instance_of(Expressir::Model::Literals::Logical)
2074
+ expect(x.value).to eq(Expressir::Model::Literals::Logical::FALSE)
2075
+ end
2076
+
2077
+ functions.find{|x| x.id == "unknown_logical_expression"}.statements[0].expression.tap do |x|
2078
+ expect(x).to be_instance_of(Expressir::Model::Literals::Logical)
2079
+ expect(x.value).to eq(Expressir::Model::Literals::Logical::UNKNOWN)
2080
+ end
2081
+
2082
+ functions.find{|x| x.id == "real_expression"}.statements[0].expression.tap do |x|
2083
+ expect(x).to be_instance_of(Expressir::Model::Literals::Real)
2084
+ expect(x.value).to eq("999.999")
2085
+ end
2086
+
2087
+ functions.find{|x| x.id == "simple_string_expression"}.statements[0].expression.tap do |x|
2088
+ expect(x).to be_instance_of(Expressir::Model::Literals::String)
2089
+ expect(x.value).to eq("xxx")
2090
+ end
2091
+
2092
+ functions.find{|x| x.id == "encoded_string_expression"}.statements[0].expression.tap do |x|
2093
+ expect(x).to be_instance_of(Expressir::Model::Literals::String)
2094
+ expect(x.value).to eq("000000780000007800000078")
2095
+ expect(x.encoded).to eq(true)
2096
+ end
2097
+
2098
+ # constant expressions
2099
+ functions.find{|x| x.id == "const_e_expression"}.statements[0].expression.tap do |x|
2100
+ expect(x).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2101
+ expect(x.id).to eq("CONST_E")
2102
+ end
2103
+
2104
+ functions.find{|x| x.id == "indeterminate_expression"}.statements[0].expression.tap do |x|
2105
+ expect(x).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2106
+ expect(x.id).to eq("?")
2107
+ end
2108
+
2109
+ functions.find{|x| x.id == "pi_expression"}.statements[0].expression.tap do |x|
2110
+ expect(x).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2111
+ expect(x.id).to eq("PI")
2112
+ end
2113
+
2114
+ functions.find{|x| x.id == "self_expression"}.statements[0].expression.tap do |x|
2115
+ expect(x).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2116
+ expect(x.id).to eq("SELF")
2117
+ end
2118
+
2119
+ # function expressions
2120
+ functions.find{|x| x.id == "abs_expression"}.statements[0].expression.tap do |x|
2121
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2122
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2123
+ expect(x.ref.id).to eq("ABS")
2124
+ expect(x.parameters).to be_instance_of(Array)
2125
+ expect(x.parameters.count).to eq(1)
2126
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2127
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2128
+ end
2129
+
2130
+ functions.find{|x| x.id == "acos_expression"}.statements[0].expression.tap do |x|
2131
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2132
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2133
+ expect(x.ref.id).to eq("ACOS")
2134
+ expect(x.parameters).to be_instance_of(Array)
2135
+ expect(x.parameters.count).to eq(1)
2136
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2137
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2138
+ end
2139
+
2140
+ functions.find{|x| x.id == "asin_expression"}.statements[0].expression.tap do |x|
2141
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2142
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2143
+ expect(x.ref.id).to eq("ASIN")
2144
+ expect(x.parameters).to be_instance_of(Array)
2145
+ expect(x.parameters.count).to eq(1)
2146
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2147
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2148
+ end
2149
+
2150
+ functions.find{|x| x.id == "atan_expression"}.statements[0].expression.tap do |x|
2151
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2152
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2153
+ expect(x.ref.id).to eq("ATAN")
2154
+ expect(x.parameters).to be_instance_of(Array)
2155
+ expect(x.parameters.count).to eq(1)
2156
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2157
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2158
+ end
2159
+
2160
+ functions.find{|x| x.id == "blength_expression"}.statements[0].expression.tap do |x|
2161
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2162
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2163
+ expect(x.ref.id).to eq("BLENGTH")
2164
+ expect(x.parameters).to be_instance_of(Array)
2165
+ expect(x.parameters.count).to eq(1)
2166
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2167
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2168
+ end
2169
+
2170
+ functions.find{|x| x.id == "cos_expression"}.statements[0].expression.tap do |x|
2171
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2172
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2173
+ expect(x.ref.id).to eq("COS")
2174
+ expect(x.parameters).to be_instance_of(Array)
2175
+ expect(x.parameters.count).to eq(1)
2176
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2177
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2178
+ end
2179
+
2180
+ functions.find{|x| x.id == "exists_expression"}.statements[0].expression.tap do |x|
2181
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2182
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2183
+ expect(x.ref.id).to eq("EXISTS")
2184
+ expect(x.parameters).to be_instance_of(Array)
2185
+ expect(x.parameters.count).to eq(1)
2186
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2187
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2188
+ end
2189
+
2190
+ functions.find{|x| x.id == "exp_expression"}.statements[0].expression.tap do |x|
2191
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2192
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2193
+ expect(x.ref.id).to eq("EXP")
2194
+ expect(x.parameters).to be_instance_of(Array)
2195
+ expect(x.parameters.count).to eq(1)
2196
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2197
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2198
+ end
2199
+
2200
+ functions.find{|x| x.id == "format_expression"}.statements[0].expression.tap do |x|
2201
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2202
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2203
+ expect(x.ref.id).to eq("FORMAT")
2204
+ expect(x.parameters).to be_instance_of(Array)
2205
+ expect(x.parameters.count).to eq(1)
2206
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2207
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2208
+ end
2209
+
2210
+ functions.find{|x| x.id == "hibound_expression"}.statements[0].expression.tap do |x|
2211
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2212
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2213
+ expect(x.ref.id).to eq("HIBOUND")
2214
+ expect(x.parameters).to be_instance_of(Array)
2215
+ expect(x.parameters.count).to eq(1)
2216
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2217
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2218
+ end
2219
+
2220
+ functions.find{|x| x.id == "hiindex_expression"}.statements[0].expression.tap do |x|
2221
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2222
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2223
+ expect(x.ref.id).to eq("HIINDEX")
2224
+ expect(x.parameters).to be_instance_of(Array)
2225
+ expect(x.parameters.count).to eq(1)
2226
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2227
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2228
+ end
2229
+
2230
+ functions.find{|x| x.id == "length_expression"}.statements[0].expression.tap do |x|
2231
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2232
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2233
+ expect(x.ref.id).to eq("LENGTH")
2234
+ expect(x.parameters).to be_instance_of(Array)
2235
+ expect(x.parameters.count).to eq(1)
2236
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2237
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2238
+ end
2239
+
2240
+ functions.find{|x| x.id == "lobound_expression"}.statements[0].expression.tap do |x|
2241
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2242
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2243
+ expect(x.ref.id).to eq("LOBOUND")
2244
+ expect(x.parameters).to be_instance_of(Array)
2245
+ expect(x.parameters.count).to eq(1)
2246
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2247
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2248
+ end
2249
+
2250
+ functions.find{|x| x.id == "loindex_expression"}.statements[0].expression.tap do |x|
2251
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2252
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2253
+ expect(x.ref.id).to eq("LOINDEX")
2254
+ expect(x.parameters).to be_instance_of(Array)
2255
+ expect(x.parameters.count).to eq(1)
2256
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2257
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2258
+ end
2259
+
2260
+ functions.find{|x| x.id == "log_expression"}.statements[0].expression.tap do |x|
2261
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2262
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2263
+ expect(x.ref.id).to eq("LOG")
2264
+ expect(x.parameters).to be_instance_of(Array)
2265
+ expect(x.parameters.count).to eq(1)
2266
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2267
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2268
+ end
2269
+
2270
+ functions.find{|x| x.id == "log2_expression"}.statements[0].expression.tap do |x|
2271
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2272
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2273
+ expect(x.ref.id).to eq("LOG2")
2274
+ expect(x.parameters).to be_instance_of(Array)
2275
+ expect(x.parameters.count).to eq(1)
2276
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2277
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2278
+ end
2279
+
2280
+ functions.find{|x| x.id == "log10_expression"}.statements[0].expression.tap do |x|
2281
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2282
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2283
+ expect(x.ref.id).to eq("LOG10")
2284
+ expect(x.parameters).to be_instance_of(Array)
2285
+ expect(x.parameters.count).to eq(1)
2286
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2287
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2288
+ end
2289
+
2290
+ functions.find{|x| x.id == "nvl_expression"}.statements[0].expression.tap do |x|
2291
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2292
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2293
+ expect(x.ref.id).to eq("NVL")
2294
+ expect(x.parameters).to be_instance_of(Array)
2295
+ expect(x.parameters.count).to eq(1)
2296
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2297
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2298
+ end
2299
+
2300
+ functions.find{|x| x.id == "odd_expression"}.statements[0].expression.tap do |x|
2301
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2302
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2303
+ expect(x.ref.id).to eq("ODD")
2304
+ expect(x.parameters).to be_instance_of(Array)
2305
+ expect(x.parameters.count).to eq(1)
2306
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2307
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2308
+ end
2309
+
2310
+ functions.find{|x| x.id == "rolesof_expression"}.statements[0].expression.tap do |x|
2311
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2312
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2313
+ expect(x.ref.id).to eq("ROLESOF")
2314
+ expect(x.parameters).to be_instance_of(Array)
2315
+ expect(x.parameters.count).to eq(1)
2316
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2317
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2318
+ end
2319
+
2320
+ functions.find{|x| x.id == "sin_expression"}.statements[0].expression.tap do |x|
2321
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2322
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2323
+ expect(x.ref.id).to eq("SIN")
2324
+ expect(x.parameters).to be_instance_of(Array)
2325
+ expect(x.parameters.count).to eq(1)
2326
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2327
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2328
+ end
2329
+
2330
+ functions.find{|x| x.id == "sizeof_expression"}.statements[0].expression.tap do |x|
2331
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2332
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2333
+ expect(x.ref.id).to eq("SIZEOF")
2334
+ expect(x.parameters).to be_instance_of(Array)
2335
+ expect(x.parameters.count).to eq(1)
2336
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2337
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2338
+ end
2339
+
2340
+ functions.find{|x| x.id == "sqrt_expression"}.statements[0].expression.tap do |x|
2341
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2342
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2343
+ expect(x.ref.id).to eq("SQRT")
2344
+ expect(x.parameters).to be_instance_of(Array)
2345
+ expect(x.parameters.count).to eq(1)
2346
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2347
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2348
+ end
2349
+
2350
+ functions.find{|x| x.id == "tan_expression"}.statements[0].expression.tap do |x|
2351
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2352
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2353
+ expect(x.ref.id).to eq("TAN")
2354
+ expect(x.parameters).to be_instance_of(Array)
2355
+ expect(x.parameters.count).to eq(1)
2356
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2357
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2358
+ end
2359
+
2360
+ functions.find{|x| x.id == "typeof_expression"}.statements[0].expression.tap do |x|
2361
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2362
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2363
+ expect(x.ref.id).to eq("TYPEOF")
2364
+ expect(x.parameters).to be_instance_of(Array)
2365
+ expect(x.parameters.count).to eq(1)
2366
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2367
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2368
+ end
2369
+
2370
+ functions.find{|x| x.id == "usedin_expression"}.statements[0].expression.tap do |x|
2371
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2372
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2373
+ expect(x.ref.id).to eq("USEDIN")
2374
+ expect(x.parameters).to be_instance_of(Array)
2375
+ expect(x.parameters.count).to eq(1)
2376
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2377
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2378
+ end
2379
+
2380
+ functions.find{|x| x.id == "value_expression"}.statements[0].expression.tap do |x|
2381
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2382
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2383
+ expect(x.ref.id).to eq("VALUE")
2384
+ expect(x.parameters).to be_instance_of(Array)
2385
+ expect(x.parameters.count).to eq(1)
2386
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2387
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2388
+ end
2389
+
2390
+ functions.find{|x| x.id == "value_in_expression"}.statements[0].expression.tap do |x|
2391
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2392
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2393
+ expect(x.ref.id).to eq("VALUE_IN")
2394
+ expect(x.parameters).to be_instance_of(Array)
2395
+ expect(x.parameters.count).to eq(1)
2396
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2397
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2398
+ end
2399
+
2400
+ functions.find{|x| x.id == "value_unique_expression"}.statements[0].expression.tap do |x|
2401
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2402
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2403
+ expect(x.ref.id).to eq("VALUE_UNIQUE")
2404
+ expect(x.parameters).to be_instance_of(Array)
2405
+ expect(x.parameters.count).to eq(1)
2406
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2407
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2408
+ end
2409
+
2410
+ # operator expressions
2411
+ functions.find{|x| x.id == "plus_expression"}.statements[0].expression.tap do |x|
2412
+ expect(x).to be_instance_of(Expressir::Model::Expressions::UnaryExpression)
2413
+ expect(x.operator).to eq(Expressir::Model::Expressions::UnaryExpression::PLUS)
2414
+ expect(x.operand).to be_instance_of(Expressir::Model::Literals::Integer)
2415
+ expect(x.operand.value).to eq("4")
2416
+ end
2417
+
2418
+ functions.find{|x| x.id == "plus_addition_expression"}.statements[0].expression.tap do |x|
2419
+ expect(x).to be_instance_of(Expressir::Model::Expressions::UnaryExpression)
2420
+ expect(x.operator).to eq(Expressir::Model::Expressions::UnaryExpression::PLUS)
2421
+ expect(x.operand).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2422
+ expect(x.operand.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
2423
+ expect(x.operand.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2424
+ expect(x.operand.operand1.value).to eq("4")
2425
+ expect(x.operand.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2426
+ expect(x.operand.operand2.value).to eq("2")
2427
+ end
2428
+
2429
+ functions.find{|x| x.id == "minus_expression"}.statements[0].expression.tap do |x|
2430
+ expect(x).to be_instance_of(Expressir::Model::Expressions::UnaryExpression)
2431
+ expect(x.operator).to eq(Expressir::Model::Expressions::UnaryExpression::MINUS)
2432
+ expect(x.operand).to be_instance_of(Expressir::Model::Literals::Integer)
2433
+ expect(x.operand.value).to eq("4")
2434
+ end
2435
+
2436
+ functions.find{|x| x.id == "minus_addition_expression"}.statements[0].expression.tap do |x|
2437
+ expect(x).to be_instance_of(Expressir::Model::Expressions::UnaryExpression)
2438
+ expect(x.operator).to eq(Expressir::Model::Expressions::UnaryExpression::MINUS)
2439
+ expect(x.operand).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2440
+ expect(x.operand.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
2441
+ expect(x.operand.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2442
+ expect(x.operand.operand1.value).to eq("4")
2443
+ expect(x.operand.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2444
+ expect(x.operand.operand2.value).to eq("2")
2445
+ end
2446
+
2447
+ functions.find{|x| x.id == "addition_expression"}.statements[0].expression.tap do |x|
2448
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2449
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
2450
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2451
+ expect(x.operand1.value).to eq("4")
2452
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2453
+ expect(x.operand2.value).to eq("2")
2454
+ end
2455
+
2456
+ functions.find{|x| x.id == "subtraction_expression"}.statements[0].expression.tap do |x|
2457
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2458
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::SUBTRACTION)
2459
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2460
+ expect(x.operand1.value).to eq("4")
2461
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2462
+ expect(x.operand2.value).to eq("2")
2463
+ end
2464
+
2465
+ functions.find{|x| x.id == "multiplication_expression"}.statements[0].expression.tap do |x|
2466
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2467
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::MULTIPLICATION)
2468
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2469
+ expect(x.operand1.value).to eq("4")
2470
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2471
+ expect(x.operand2.value).to eq("2")
2472
+ end
2473
+
2474
+ functions.find{|x| x.id == "real_division_expression"}.statements[0].expression.tap do |x|
2475
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2476
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::REAL_DIVISION)
2477
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2478
+ expect(x.operand1.value).to eq("4")
2479
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2480
+ expect(x.operand2.value).to eq("2")
2481
+ end
2482
+
2483
+ functions.find{|x| x.id == "integer_division_expression"}.statements[0].expression.tap do |x|
2484
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2485
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::INTEGER_DIVISION)
2486
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2487
+ expect(x.operand1.value).to eq("4")
2488
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2489
+ expect(x.operand2.value).to eq("2")
2490
+ end
2491
+
2492
+ functions.find{|x| x.id == "modulo_expression"}.statements[0].expression.tap do |x|
2493
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2494
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::MODULO)
2495
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2496
+ expect(x.operand1.value).to eq("4")
2497
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2498
+ expect(x.operand2.value).to eq("2")
2499
+ end
2500
+
2501
+ functions.find{|x| x.id == "exponentiation_expression"}.statements[0].expression.tap do |x|
2502
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2503
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::EXPONENTIATION)
2504
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2505
+ expect(x.operand1.value).to eq("4")
2506
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2507
+ expect(x.operand2.value).to eq("2")
2508
+ end
2509
+
2510
+ functions.find{|x| x.id == "addition_addition_expression"}.statements[0].expression.tap do |x|
2511
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2512
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
2513
+ expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2514
+ expect(x.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
2515
+ expect(x.operand1.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2516
+ expect(x.operand1.operand1.value).to eq("4")
2517
+ expect(x.operand1.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2518
+ expect(x.operand1.operand2.value).to eq("2")
2519
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2520
+ expect(x.operand2.value).to eq("1")
2521
+ end
2522
+
2523
+ functions.find{|x| x.id == "subtraction_subtraction_expression"}.statements[0].expression.tap do |x|
2524
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2525
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::SUBTRACTION)
2526
+ expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2527
+ expect(x.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::SUBTRACTION)
2528
+ expect(x.operand1.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2529
+ expect(x.operand1.operand1.value).to eq("4")
2530
+ expect(x.operand1.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2531
+ expect(x.operand1.operand2.value).to eq("2")
2532
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2533
+ expect(x.operand2.value).to eq("1")
2534
+ end
2535
+
2536
+ functions.find{|x| x.id == "addition_subtraction_expression"}.statements[0].expression.tap do |x|
2537
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2538
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::SUBTRACTION)
2539
+ expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2540
+ expect(x.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
2541
+ expect(x.operand1.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2542
+ expect(x.operand1.operand1.value).to eq("4")
2543
+ expect(x.operand1.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2544
+ expect(x.operand1.operand2.value).to eq("2")
2545
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2546
+ expect(x.operand2.value).to eq("1")
2547
+ end
2548
+
2549
+ functions.find{|x| x.id == "subtraction_addition_expression"}.statements[0].expression.tap do |x|
2550
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2551
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
2552
+ expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2553
+ expect(x.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::SUBTRACTION)
2554
+ expect(x.operand1.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2555
+ expect(x.operand1.operand1.value).to eq("4")
2556
+ expect(x.operand1.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2557
+ expect(x.operand1.operand2.value).to eq("2")
2558
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2559
+ expect(x.operand2.value).to eq("1")
2560
+ end
2561
+
2562
+ functions.find{|x| x.id == "addition_multiplication_expression"}.statements[0].expression.tap do |x|
2563
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2564
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
2565
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2566
+ expect(x.operand1.value).to eq("8")
2567
+ expect(x.operand2).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2568
+ expect(x.operand2.operator).to eq(Expressir::Model::Expressions::BinaryExpression::MULTIPLICATION)
2569
+ expect(x.operand2.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2570
+ expect(x.operand2.operand1.value).to eq("4")
2571
+ expect(x.operand2.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2572
+ expect(x.operand2.operand2.value).to eq("2")
2573
+ end
2574
+
2575
+ functions.find{|x| x.id == "multiplication_addition_expression"}.statements[0].expression.tap do |x|
2576
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2577
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
2578
+ expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2579
+ expect(x.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::MULTIPLICATION)
2580
+ expect(x.operand1.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2581
+ expect(x.operand1.operand1.value).to eq("8")
2582
+ expect(x.operand1.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2583
+ expect(x.operand1.operand2.value).to eq("4")
2584
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2585
+ expect(x.operand2.value).to eq("2")
2586
+ end
2587
+
2588
+ functions.find{|x| x.id == "parenthesis_addition_multiplication_expression"}.statements[0].expression.tap do |x|
2589
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2590
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::MULTIPLICATION)
2591
+ expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2592
+ expect(x.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
2593
+ expect(x.operand1.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2594
+ expect(x.operand1.operand1.value).to eq("8")
2595
+ expect(x.operand1.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2596
+ expect(x.operand1.operand2.value).to eq("4")
2597
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2598
+ expect(x.operand2.value).to eq("2")
2599
+ end
2600
+
2601
+ functions.find{|x| x.id == "multiplication_parenthesis_addition_expression"}.statements[0].expression.tap do |x|
2602
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2603
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::MULTIPLICATION)
2604
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2605
+ expect(x.operand1.value).to eq("8")
2606
+ expect(x.operand2).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2607
+ expect(x.operand2.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
2608
+ expect(x.operand2.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2609
+ expect(x.operand2.operand1.value).to eq("4")
2610
+ expect(x.operand2.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2611
+ expect(x.operand2.operand2.value).to eq("2")
2612
+ end
2613
+
2614
+ functions.find{|x| x.id == "equal_expression"}.statements[0].expression.tap do |x|
2615
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2616
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::EQUAL)
2617
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2618
+ expect(x.operand1.value).to eq("4")
2619
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2620
+ expect(x.operand2.value).to eq("2")
2621
+ end
2622
+
2623
+ functions.find{|x| x.id == "not_equal_expression"}.statements[0].expression.tap do |x|
2624
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2625
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::NOT_EQUAL)
2626
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2627
+ expect(x.operand1.value).to eq("4")
2628
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2629
+ expect(x.operand2.value).to eq("2")
2630
+ end
2631
+
2632
+ functions.find{|x| x.id == "instance_equal_expression"}.statements[0].expression.tap do |x|
2633
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2634
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::INSTANCE_EQUAL)
2635
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2636
+ expect(x.operand1.value).to eq("4")
2637
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2638
+ expect(x.operand2.value).to eq("2")
2639
+ end
2640
+
2641
+ functions.find{|x| x.id == "instance_not_equal_expression"}.statements[0].expression.tap do |x|
2642
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2643
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::INSTANCE_NOT_EQUAL)
2644
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2645
+ expect(x.operand1.value).to eq("4")
2646
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2647
+ expect(x.operand2.value).to eq("2")
2648
+ end
2649
+
2650
+ functions.find{|x| x.id == "lt_expression"}.statements[0].expression.tap do |x|
2651
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2652
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::LESS_THAN)
2653
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2654
+ expect(x.operand1.value).to eq("4")
2655
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2656
+ expect(x.operand2.value).to eq("2")
2657
+ end
2658
+
2659
+ functions.find{|x| x.id == "gt_expression"}.statements[0].expression.tap do |x|
2660
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2661
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::GREATER_THAN)
2662
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2663
+ expect(x.operand1.value).to eq("4")
2664
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2665
+ expect(x.operand2.value).to eq("2")
2666
+ end
2667
+
2668
+ functions.find{|x| x.id == "lte_expression"}.statements[0].expression.tap do |x|
2669
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2670
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::LESS_THAN_OR_EQUAL)
2671
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2672
+ expect(x.operand1.value).to eq("4")
2673
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2674
+ expect(x.operand2.value).to eq("2")
2675
+ end
2676
+
2677
+ functions.find{|x| x.id == "gte_expression"}.statements[0].expression.tap do |x|
2678
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2679
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::GREATER_THAN_OR_EQUAL)
2680
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2681
+ expect(x.operand1.value).to eq("4")
2682
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2683
+ expect(x.operand2.value).to eq("2")
2684
+ end
2685
+
2686
+ functions.find{|x| x.id == "not_expression"}.statements[0].expression.tap do |x|
2687
+ expect(x).to be_instance_of(Expressir::Model::Expressions::UnaryExpression)
2688
+ expect(x.operator).to eq(Expressir::Model::Expressions::UnaryExpression::NOT)
2689
+ expect(x.operand).to be_instance_of(Expressir::Model::Literals::Logical)
2690
+ expect(x.operand.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2691
+ end
2692
+
2693
+ functions.find{|x| x.id == "not_or_expression"}.statements[0].expression.tap do |x|
2694
+ expect(x).to be_instance_of(Expressir::Model::Expressions::UnaryExpression)
2695
+ expect(x.operator).to eq(Expressir::Model::Expressions::UnaryExpression::NOT)
2696
+ expect(x.operand).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2697
+ expect(x.operand.operator).to eq(Expressir::Model::Expressions::BinaryExpression::OR)
2698
+ expect(x.operand.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
2699
+ expect(x.operand.operand1.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2700
+ expect(x.operand.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
2701
+ expect(x.operand.operand2.value).to eq(Expressir::Model::Literals::Logical::FALSE)
2702
+ end
2703
+
2704
+ functions.find{|x| x.id == "or_expression"}.statements[0].expression.tap do |x|
2705
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2706
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::OR)
2707
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
2708
+ expect(x.operand1.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2709
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
2710
+ expect(x.operand2.value).to eq(Expressir::Model::Literals::Logical::FALSE)
2711
+ end
2712
+
2713
+ functions.find{|x| x.id == "and_expression"}.statements[0].expression.tap do |x|
2714
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2715
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
2716
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
2717
+ expect(x.operand1.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2718
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
2719
+ expect(x.operand2.value).to eq(Expressir::Model::Literals::Logical::FALSE)
2720
+ end
2721
+
2722
+ functions.find{|x| x.id == "or_or_expression"}.statements[0].expression.tap do |x|
2723
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2724
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::OR)
2725
+ expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2726
+ expect(x.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::OR)
2727
+ expect(x.operand1.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
2728
+ expect(x.operand1.operand1.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2729
+ expect(x.operand1.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
2730
+ expect(x.operand1.operand2.value).to eq(Expressir::Model::Literals::Logical::FALSE)
2731
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
2732
+ expect(x.operand2.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2733
+ end
2734
+
2735
+ functions.find{|x| x.id == "and_and_expression"}.statements[0].expression.tap do |x|
2736
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2737
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
2738
+ expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2739
+ expect(x.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
2740
+ expect(x.operand1.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
2741
+ expect(x.operand1.operand1.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2742
+ expect(x.operand1.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
2743
+ expect(x.operand1.operand2.value).to eq(Expressir::Model::Literals::Logical::FALSE)
2744
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
2745
+ expect(x.operand2.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2746
+ end
2747
+
2748
+ functions.find{|x| x.id == "or_and_expression"}.statements[0].expression.tap do |x|
2749
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2750
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::OR)
2751
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
2752
+ expect(x.operand1.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2753
+ expect(x.operand2).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2754
+ expect(x.operand2.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
2755
+ expect(x.operand2.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
2756
+ expect(x.operand2.operand1.value).to eq(Expressir::Model::Literals::Logical::FALSE)
2757
+ expect(x.operand2.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
2758
+ expect(x.operand2.operand2.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2759
+ end
2760
+
2761
+ functions.find{|x| x.id == "and_or_expression"}.statements[0].expression.tap do |x|
2762
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2763
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::OR)
2764
+ expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2765
+ expect(x.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
2766
+ expect(x.operand1.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
2767
+ expect(x.operand1.operand1.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2768
+ expect(x.operand1.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
2769
+ expect(x.operand1.operand2.value).to eq(Expressir::Model::Literals::Logical::FALSE)
2770
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
2771
+ expect(x.operand2.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2772
+ end
2773
+
2774
+ functions.find{|x| x.id == "parenthesis_or_and_expression"}.statements[0].expression.tap do |x|
2775
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2776
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
2777
+ expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2778
+ expect(x.operand1.operator).to eq(Expressir::Model::Expressions::BinaryExpression::OR)
2779
+ expect(x.operand1.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
2780
+ expect(x.operand1.operand1.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2781
+ expect(x.operand1.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
2782
+ expect(x.operand1.operand2.value).to eq(Expressir::Model::Literals::Logical::FALSE)
2783
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
2784
+ expect(x.operand2.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2785
+ end
2786
+
2787
+ functions.find{|x| x.id == "and_parenthesis_or_expression"}.statements[0].expression.tap do |x|
2788
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2789
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::AND)
2790
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
2791
+ expect(x.operand1.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2792
+ expect(x.operand2).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2793
+ expect(x.operand2.operator).to eq(Expressir::Model::Expressions::BinaryExpression::OR)
2794
+ expect(x.operand2.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
2795
+ expect(x.operand2.operand1.value).to eq(Expressir::Model::Literals::Logical::FALSE)
2796
+ expect(x.operand2.operand2).to be_instance_of(Expressir::Model::Literals::Logical)
2797
+ expect(x.operand2.operand2.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2798
+ end
2799
+
2800
+ # aggregate initializer expressions
2801
+ functions.find{|x| x.id == "aggregate_initializer_expression"}.statements[0].expression.tap do |x|
2802
+ expect(x).to be_instance_of(Expressir::Model::Expressions::AggregateInitializer)
2803
+ expect(x.items).to be_instance_of(Array)
2804
+ expect(x.items.count).to eq(1)
2805
+ expect(x.items[0]).to be_instance_of(Expressir::Model::Literals::Integer)
2806
+ expect(x.items[0].value).to eq("4")
2807
+ end
2808
+
2809
+ functions.find{|x| x.id == "repeated_aggregate_initializer_expression"}.statements[0].expression.tap do |x|
2810
+ expect(x).to be_instance_of(Expressir::Model::Expressions::AggregateInitializer)
2811
+ expect(x.items).to be_instance_of(Array)
2812
+ expect(x.items.count).to eq(1)
2813
+ expect(x.items[0]).to be_instance_of(Expressir::Model::Expressions::AggregateItem)
2814
+ expect(x.items[0].expression).to be_instance_of(Expressir::Model::Literals::Integer)
2815
+ expect(x.items[0].expression.value).to eq("4")
2816
+ expect(x.items[0].repetition).to be_instance_of(Expressir::Model::Literals::Integer)
2817
+ expect(x.items[0].repetition.value).to eq("2")
2818
+ end
2819
+
2820
+ functions.find{|x| x.id == "complex_aggregate_initializer_expression"}.statements[0].expression.tap do |x|
2821
+ expect(x).to be_instance_of(Expressir::Model::Expressions::AggregateInitializer)
2822
+ expect(x.items).to be_instance_of(Array)
2823
+ expect(x.items.count).to eq(1)
2824
+ expect(x.items[0]).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2825
+ expect(x.items[0].operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
2826
+ expect(x.items[0].operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2827
+ expect(x.items[0].operand1.value).to eq("4")
2828
+ expect(x.items[0].operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2829
+ expect(x.items[0].operand2.value).to eq("2")
2830
+ end
2831
+
2832
+ functions.find{|x| x.id == "complex_repeated_aggregate_initializer_expression"}.statements[0].expression.tap do |x|
2833
+ expect(x).to be_instance_of(Expressir::Model::Expressions::AggregateInitializer)
2834
+ expect(x.items).to be_instance_of(Array)
2835
+ expect(x.items.count).to eq(1)
2836
+ expect(x.items[0]).to be_instance_of(Expressir::Model::Expressions::AggregateItem)
2837
+ expect(x.items[0].expression).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2838
+ expect(x.items[0].expression.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
2839
+ expect(x.items[0].expression.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2840
+ expect(x.items[0].expression.operand1.value).to eq("4")
2841
+ expect(x.items[0].expression.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2842
+ expect(x.items[0].expression.operand2.value).to eq("2")
2843
+ expect(x.items[0].repetition).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2844
+ expect(x.items[0].repetition.operator).to eq(Expressir::Model::Expressions::BinaryExpression::ADDITION)
2845
+ expect(x.items[0].repetition.operand1).to be_instance_of(Expressir::Model::Literals::Integer)
2846
+ expect(x.items[0].repetition.operand1.value).to eq("4")
2847
+ expect(x.items[0].repetition.operand2).to be_instance_of(Expressir::Model::Literals::Integer)
2848
+ expect(x.items[0].repetition.operand2.value).to eq("2")
2849
+ end
2850
+
2851
+ # function call or entity constructor expressions
2852
+ functions.find{|x| x.id == "call_expression"}.statements[0].expression.tap do |x|
2853
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Call)
2854
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2855
+ expect(x.ref.id).to eq("parameter_function")
2856
+ expect(x.parameters).to be_instance_of(Array)
2857
+ expect(x.parameters.count).to eq(1)
2858
+ expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2859
+ expect(x.parameters[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2860
+ end
2861
+
2862
+ # reference expressions
2863
+ functions.find{|x| x.id == "simple_reference_expression"}.statements[0].expression.tap do |x|
2864
+ expect(x).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2865
+ expect(x.id).to eq("simple_string_expression")
2866
+ end
2867
+
2868
+ functions.find{|x| x.id == "attribute_reference_expression"}.statements[0].expression.tap do |x|
2869
+ expect(x).to be_instance_of(Expressir::Model::Expressions::AttributeReference)
2870
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2871
+ expect(x.ref.id).to eq("simple_string_expression")
2872
+ expect(x.attribute).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2873
+ expect(x.attribute.id).to eq("test")
2874
+ end
2875
+
2876
+ functions.find{|x| x.id == "group_reference_expression"}.statements[0].expression.tap do |x|
2877
+ expect(x).to be_instance_of(Expressir::Model::Expressions::GroupReference)
2878
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2879
+ expect(x.ref.id).to eq("simple_string_expression")
2880
+ expect(x.entity).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2881
+ expect(x.entity.id).to eq("test")
2882
+ end
2883
+
2884
+ functions.find{|x| x.id == "index_reference_expression"}.statements[0].expression.tap do |x|
2885
+ expect(x).to be_instance_of(Expressir::Model::Expressions::IndexReference)
2886
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2887
+ expect(x.ref.id).to eq("simple_string_expression")
2888
+ expect(x.index1).to be_instance_of(Expressir::Model::Literals::Integer)
2889
+ expect(x.index1.value).to eq("1")
2890
+ end
2891
+
2892
+ functions.find{|x| x.id == "index2_reference_expression"}.statements[0].expression.tap do |x|
2893
+ expect(x).to be_instance_of(Expressir::Model::Expressions::IndexReference)
2894
+ expect(x.ref).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2895
+ expect(x.ref.id).to eq("simple_string_expression")
2896
+ expect(x.index1).to be_instance_of(Expressir::Model::Literals::Integer)
2897
+ expect(x.index1.value).to eq("1")
2898
+ expect(x.index2).to be_instance_of(Expressir::Model::Literals::Integer)
2899
+ expect(x.index2.value).to eq("9")
2900
+ end
2901
+
2902
+ # interval expressions
2903
+ functions.find{|x| x.id == "lt_lt_interval_expression"}.statements[0].expression.tap do |x|
2904
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Interval)
2905
+ expect(x.low).to be_instance_of(Expressir::Model::Literals::Integer)
2906
+ expect(x.low.value).to eq("1")
2907
+ expect(x.operator1).to eq(Expressir::Model::Expressions::BinaryExpression::LESS_THAN)
2908
+ expect(x.item).to be_instance_of(Expressir::Model::Literals::Integer)
2909
+ expect(x.item.value).to eq("5")
2910
+ expect(x.operator2).to eq(Expressir::Model::Expressions::BinaryExpression::LESS_THAN)
2911
+ expect(x.high).to be_instance_of(Expressir::Model::Literals::Integer)
2912
+ expect(x.high.value).to eq("9")
2913
+ end
2914
+
2915
+ functions.find{|x| x.id == "lte_lt_interval_expression"}.statements[0].expression.tap do |x|
2916
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Interval)
2917
+ expect(x.low).to be_instance_of(Expressir::Model::Literals::Integer)
2918
+ expect(x.low.value).to eq("1")
2919
+ expect(x.operator1).to eq(Expressir::Model::Expressions::BinaryExpression::LESS_THAN_OR_EQUAL)
2920
+ expect(x.item).to be_instance_of(Expressir::Model::Literals::Integer)
2921
+ expect(x.item.value).to eq("5")
2922
+ expect(x.operator2).to eq(Expressir::Model::Expressions::BinaryExpression::LESS_THAN)
2923
+ expect(x.high).to be_instance_of(Expressir::Model::Literals::Integer)
2924
+ expect(x.high.value).to eq("9")
2925
+ end
2926
+
2927
+ functions.find{|x| x.id == "lt_lte_interval_expression"}.statements[0].expression.tap do |x|
2928
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Interval)
2929
+ expect(x.low).to be_instance_of(Expressir::Model::Literals::Integer)
2930
+ expect(x.low.value).to eq("1")
2931
+ expect(x.operator1).to eq(Expressir::Model::Expressions::BinaryExpression::LESS_THAN)
2932
+ expect(x.item).to be_instance_of(Expressir::Model::Literals::Integer)
2933
+ expect(x.item.value).to eq("5")
2934
+ expect(x.operator2).to eq(Expressir::Model::Expressions::BinaryExpression::LESS_THAN_OR_EQUAL)
2935
+ expect(x.high).to be_instance_of(Expressir::Model::Literals::Integer)
2936
+ expect(x.high.value).to eq("9")
2937
+ end
2938
+
2939
+ functions.find{|x| x.id == "lte_lte_interval_expression"}.statements[0].expression.tap do |x|
2940
+ expect(x).to be_instance_of(Expressir::Model::Expressions::Interval)
2941
+ expect(x.low).to be_instance_of(Expressir::Model::Literals::Integer)
2942
+ expect(x.low.value).to eq("1")
2943
+ expect(x.operator1).to eq(Expressir::Model::Expressions::BinaryExpression::LESS_THAN_OR_EQUAL)
2944
+ expect(x.item).to be_instance_of(Expressir::Model::Literals::Integer)
2945
+ expect(x.item.value).to eq("5")
2946
+ expect(x.operator2).to eq(Expressir::Model::Expressions::BinaryExpression::LESS_THAN_OR_EQUAL)
2947
+ expect(x.high).to be_instance_of(Expressir::Model::Literals::Integer)
2948
+ expect(x.high.value).to eq("9")
2949
+ end
2950
+
2951
+ functions.find{|x| x.id == "combine_expression"}.statements[0].expression.tap do |x|
2952
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2953
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::COMBINE)
2954
+ expect(x.operand1).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2955
+ expect(x.operand1.id).to eq("test")
2956
+ expect(x.operand2).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2957
+ expect(x.operand2.id).to eq("test")
2958
+ end
2959
+
2960
+ functions.find{|x| x.id == "in_expression"}.statements[0].expression.tap do |x|
2961
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2962
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::IN)
2963
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::Logical)
2964
+ expect(x.operand1.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2965
+ expect(x.operand2).to be_instance_of(Expressir::Model::Expressions::AggregateInitializer)
2966
+ expect(x.operand2.items).to be_instance_of(Array)
2967
+ expect(x.operand2.items.count).to eq(1)
2968
+ expect(x.operand2.items[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2969
+ expect(x.operand2.items[0].value).to eq(Expressir::Model::Literals::Logical::TRUE)
2970
+ end
2971
+
2972
+ functions.find{|x| x.id == "like_expression"}.statements[0].expression.tap do |x|
2973
+ expect(x).to be_instance_of(Expressir::Model::Expressions::BinaryExpression)
2974
+ expect(x.operator).to eq(Expressir::Model::Expressions::BinaryExpression::LIKE)
2975
+ expect(x.operand1).to be_instance_of(Expressir::Model::Literals::String)
2976
+ expect(x.operand1.value).to eq("xxx")
2977
+ expect(x.operand2).to be_instance_of(Expressir::Model::Literals::String)
2978
+ expect(x.operand2.value).to eq("xxx")
2979
+ end
2980
+
2981
+ # query expressions
2982
+ functions.find{|x| x.id == "query_expression"}.statements[0].expression.tap do |x|
2983
+ expect(x).to be_instance_of(Expressir::Model::Expressions::QueryExpression)
2984
+ expect(x.id).to eq("test")
2985
+ expect(x.source).to be_instance_of(Expressir::Model::Expressions::SimpleReference)
2986
+ expect(x.source.id).to eq("test2")
2987
+ expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
2988
+ expect(x.expression.value).to eq(Expressir::Model::Literals::Logical::TRUE)
2989
+ end
2990
+ end
2991
+ end
2992
+
2993
+ def sample_file
2994
+ @sample_file ||= Expressir.root_path.join(
2995
+ "original", "examples", "syntax", "syntax.exp"
2996
+ )
2997
+ end
2998
+ end