github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library@v0.2.0/JSON_Grammar/JSON_Grammar.go (about) 1 // Package JSON_Grammar 2 // Dafny module JSON_Grammar compiled into Go 3 4 package JSON_Grammar 5 6 import ( 7 os "os" 8 9 m_Actions "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Actions" 10 m_Base64 "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Base64" 11 m_Base64Lemmas "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Base64Lemmas" 12 m_BoundedInts "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/BoundedInts" 13 m_DivInternals "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/DivInternals" 14 m_DivInternalsNonlinear "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/DivInternalsNonlinear" 15 m_DivMod "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/DivMod" 16 m_FileIO "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/FileIO" 17 m_FloatCompare "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/FloatCompare" 18 m_Functions "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Functions" 19 m_GeneralInternals "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/GeneralInternals" 20 m_GetOpt "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/GetOpt" 21 m_HexStrings "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/HexStrings" 22 m_JSON_Errors "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/JSON_Errors" 23 m_JSON_Spec "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/JSON_Spec" 24 m_JSON_Utils_Cursors "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/JSON_Utils_Cursors" 25 m_JSON_Utils_Lexers_Core "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/JSON_Utils_Lexers_Core" 26 m_JSON_Utils_Lexers_Strings "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/JSON_Utils_Lexers_Strings" 27 m_JSON_Utils_Parsers "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/JSON_Utils_Parsers" 28 m_JSON_Utils_Seq "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/JSON_Utils_Seq" 29 m_JSON_Utils_Str "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/JSON_Utils_Str" 30 m_JSON_Utils_Str_CharStrConversion "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/JSON_Utils_Str_CharStrConversion" 31 m_JSON_Utils_Str_CharStrEscaping "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/JSON_Utils_Str_CharStrEscaping" 32 m_JSON_Utils_Vectors "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/JSON_Utils_Vectors" 33 m_JSON_Utils_Views_Core "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/JSON_Utils_Views_Core" 34 m_JSON_Utils_Views_Writers "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/JSON_Utils_Views_Writers" 35 m_JSON_Values "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/JSON_Values" 36 m_Logarithm "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Logarithm" 37 m__Math "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Math_" 38 m_ModInternals "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/ModInternals" 39 m_ModInternalsNonlinear "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/ModInternalsNonlinear" 40 m_Mul "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Mul" 41 m_MulInternals "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/MulInternals" 42 m_MulInternalsNonlinear "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/MulInternalsNonlinear" 43 m_Power "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Power" 44 m_Relations "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Relations" 45 m_Seq "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Seq" 46 m_Seq_MergeSort "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Seq_MergeSort" 47 m_Sorting "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Sorting" 48 m_StandardLibrary "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/StandardLibrary" 49 m_StandardLibraryInterop "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/StandardLibraryInterop" 50 m_StandardLibrary_Sequence "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/StandardLibrary_Sequence" 51 m_StandardLibrary_String "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/StandardLibrary_String" 52 m_StandardLibrary_UInt "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/StandardLibrary_UInt" 53 m_Streams "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Streams" 54 m_UnicodeStrings "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/UnicodeStrings" 55 m__Unicode "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Unicode_" 56 m_Utf16EncodingForm "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Utf16EncodingForm" 57 m_Utf8EncodingForm "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Utf8EncodingForm" 58 m_Wrappers "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Wrappers" 59 m__System "github.com/dafny-lang/DafnyRuntimeGo/v4/System_" 60 _dafny "github.com/dafny-lang/DafnyRuntimeGo/v4/dafny" 61 ) 62 63 var _ = os.Args 64 var _ _dafny.Dummy__ 65 var _ m__System.Dummy__ 66 var _ m_Wrappers.Dummy__ 67 var _ m_Relations.Dummy__ 68 var _ m_Seq_MergeSort.Dummy__ 69 var _ m__Math.Dummy__ 70 var _ m_Seq.Dummy__ 71 var _ m_BoundedInts.Dummy__ 72 var _ m__Unicode.Dummy__ 73 var _ m_Functions.Dummy__ 74 var _ m_Utf8EncodingForm.Dummy__ 75 var _ m_Utf16EncodingForm.Dummy__ 76 var _ m_UnicodeStrings.Dummy__ 77 var _ m_FileIO.Dummy__ 78 var _ m_GeneralInternals.Dummy__ 79 var _ m_MulInternalsNonlinear.Dummy__ 80 var _ m_MulInternals.Dummy__ 81 var _ m_Mul.Dummy__ 82 var _ m_ModInternalsNonlinear.Dummy__ 83 var _ m_DivInternalsNonlinear.Dummy__ 84 var _ m_ModInternals.Dummy__ 85 var _ m_DivInternals.Dummy__ 86 var _ m_DivMod.Dummy__ 87 var _ m_Power.Dummy__ 88 var _ m_Logarithm.Dummy__ 89 var _ m_StandardLibraryInterop.Dummy__ 90 var _ m_StandardLibrary_UInt.Dummy__ 91 var _ m_StandardLibrary_Sequence.Dummy__ 92 var _ m_StandardLibrary_String.Dummy__ 93 var _ m_StandardLibrary.Dummy__ 94 var _ m_Streams.Dummy__ 95 var _ m_Sorting.Dummy__ 96 var _ m_HexStrings.Dummy__ 97 var _ m_GetOpt.Dummy__ 98 var _ m_FloatCompare.Dummy__ 99 var _ m_Base64.Dummy__ 100 var _ m_Base64Lemmas.Dummy__ 101 var _ m_Actions.Dummy__ 102 var _ m_JSON_Utils_Views_Core.Dummy__ 103 var _ m_JSON_Utils_Views_Writers.Dummy__ 104 var _ m_JSON_Utils_Lexers_Core.Dummy__ 105 var _ m_JSON_Utils_Lexers_Strings.Dummy__ 106 var _ m_JSON_Utils_Cursors.Dummy__ 107 var _ m_JSON_Utils_Parsers.Dummy__ 108 var _ m_JSON_Utils_Str_CharStrConversion.Dummy__ 109 var _ m_JSON_Utils_Str_CharStrEscaping.Dummy__ 110 var _ m_JSON_Utils_Str.Dummy__ 111 var _ m_JSON_Utils_Seq.Dummy__ 112 var _ m_JSON_Utils_Vectors.Dummy__ 113 var _ m_JSON_Errors.Dummy__ 114 var _ m_JSON_Values.Dummy__ 115 var _ m_JSON_Spec.Dummy__ 116 117 type Dummy__ struct{} 118 119 // Definition of class Default__ 120 type Default__ struct { 121 dummy byte 122 } 123 124 func New_Default___() *Default__ { 125 _this := Default__{} 126 127 return &_this 128 } 129 130 type CompanionStruct_Default___ struct { 131 } 132 133 var Companion_Default___ = CompanionStruct_Default___{} 134 135 func (_this *Default__) Equals(other *Default__) bool { 136 return _this == other 137 } 138 139 func (_this *Default__) EqualsGeneric(x interface{}) bool { 140 other, ok := x.(*Default__) 141 return ok && _this.Equals(other) 142 } 143 144 func (*Default__) String() string { 145 return "JSON_Grammar.Default__" 146 } 147 func (_this *Default__) ParentTraits_() []*_dafny.TraitID { 148 return [](*_dafny.TraitID){} 149 } 150 151 var _ _dafny.TraitOffspring = &Default__{} 152 153 func (_static *CompanionStruct_Default___) Blank_q(b uint8) bool { 154 return ((((b) == (uint8(32))) || ((b) == (uint8(9)))) || ((b) == (uint8(10)))) || ((b) == (uint8(13))) 155 } 156 func (_static *CompanionStruct_Default___) Digit_q(b uint8) bool { 157 return ((uint8(_dafny.Char('0'))) <= (b)) && ((b) <= (uint8(_dafny.Char('9')))) 158 } 159 func (_static *CompanionStruct_Default___) NULL() _dafny.Sequence { 160 return _dafny.SeqOf(uint8(_dafny.Char('n')), uint8(_dafny.Char('u')), uint8(_dafny.Char('l')), uint8(_dafny.Char('l'))) 161 } 162 func (_static *CompanionStruct_Default___) TRUE() _dafny.Sequence { 163 return _dafny.SeqOf(uint8(_dafny.Char('t')), uint8(_dafny.Char('r')), uint8(_dafny.Char('u')), uint8(_dafny.Char('e'))) 164 } 165 func (_static *CompanionStruct_Default___) FALSE() _dafny.Sequence { 166 return _dafny.SeqOf(uint8(_dafny.Char('f')), uint8(_dafny.Char('a')), uint8(_dafny.Char('l')), uint8(_dafny.Char('s')), uint8(_dafny.Char('e'))) 167 } 168 func (_static *CompanionStruct_Default___) DOUBLEQUOTE() m_JSON_Utils_Views_Core.View__ { 169 return m_JSON_Utils_Views_Core.Companion_View___.OfBytes(_dafny.SeqOf(uint8(_dafny.Char('"')))) 170 } 171 func (_static *CompanionStruct_Default___) PERIOD() m_JSON_Utils_Views_Core.View__ { 172 return m_JSON_Utils_Views_Core.Companion_View___.OfBytes(_dafny.SeqOf(uint8(_dafny.Char('.')))) 173 } 174 func (_static *CompanionStruct_Default___) E() m_JSON_Utils_Views_Core.View__ { 175 return m_JSON_Utils_Views_Core.Companion_View___.OfBytes(_dafny.SeqOf(uint8(_dafny.Char('e')))) 176 } 177 func (_static *CompanionStruct_Default___) COLON() m_JSON_Utils_Views_Core.View__ { 178 return m_JSON_Utils_Views_Core.Companion_View___.OfBytes(_dafny.SeqOf(uint8(_dafny.Char(':')))) 179 } 180 func (_static *CompanionStruct_Default___) COMMA() m_JSON_Utils_Views_Core.View__ { 181 return m_JSON_Utils_Views_Core.Companion_View___.OfBytes(_dafny.SeqOf(uint8(_dafny.Char(',')))) 182 } 183 func (_static *CompanionStruct_Default___) LBRACE() m_JSON_Utils_Views_Core.View__ { 184 return m_JSON_Utils_Views_Core.Companion_View___.OfBytes(_dafny.SeqOf(uint8(_dafny.Char('{')))) 185 } 186 func (_static *CompanionStruct_Default___) RBRACE() m_JSON_Utils_Views_Core.View__ { 187 return m_JSON_Utils_Views_Core.Companion_View___.OfBytes(_dafny.SeqOf(uint8(_dafny.Char('}')))) 188 } 189 func (_static *CompanionStruct_Default___) LBRACKET() m_JSON_Utils_Views_Core.View__ { 190 return m_JSON_Utils_Views_Core.Companion_View___.OfBytes(_dafny.SeqOf(uint8(_dafny.Char('[')))) 191 } 192 func (_static *CompanionStruct_Default___) RBRACKET() m_JSON_Utils_Views_Core.View__ { 193 return m_JSON_Utils_Views_Core.Companion_View___.OfBytes(_dafny.SeqOf(uint8(_dafny.Char(']')))) 194 } 195 func (_static *CompanionStruct_Default___) MINUS() m_JSON_Utils_Views_Core.View__ { 196 return m_JSON_Utils_Views_Core.Companion_View___.OfBytes(_dafny.SeqOf(uint8(_dafny.Char('-')))) 197 } 198 func (_static *CompanionStruct_Default___) EMPTY() m_JSON_Utils_Views_Core.View__ { 199 return m_JSON_Utils_Views_Core.Companion_View___.OfBytes(_dafny.SeqOf()) 200 } 201 202 // End of class Default__ 203 204 // Definition of class Jchar 205 type Jchar struct { 206 } 207 208 func New_Jchar_() *Jchar { 209 _this := Jchar{} 210 211 return &_this 212 } 213 214 type CompanionStruct_Jchar_ struct { 215 } 216 217 var Companion_Jchar_ = CompanionStruct_Jchar_{} 218 219 func (*Jchar) String() string { 220 return "JSON_Grammar.Jchar" 221 } 222 func (_this *CompanionStruct_Jchar_) Witness() m_JSON_Utils_Views_Core.View__ { 223 return m_JSON_Utils_Views_Core.Companion_View___.OfBytes(_dafny.SeqOf(uint8(_dafny.Char('b')))) 224 } 225 226 // End of class Jchar 227 228 func Type_Jchar_() _dafny.TypeDescriptor { 229 return type_Jchar_{} 230 } 231 232 type type_Jchar_ struct { 233 } 234 235 func (_this type_Jchar_) Default() interface{} { 236 return Companion_Jchar_.Witness() 237 } 238 239 func (_this type_Jchar_) String() string { 240 return "JSON_Grammar.Jchar" 241 } 242 243 // Definition of class Jquote 244 type Jquote struct { 245 } 246 247 func New_Jquote_() *Jquote { 248 _this := Jquote{} 249 250 return &_this 251 } 252 253 type CompanionStruct_Jquote_ struct { 254 } 255 256 var Companion_Jquote_ = CompanionStruct_Jquote_{} 257 258 func (*Jquote) String() string { 259 return "JSON_Grammar.Jquote" 260 } 261 func (_this *CompanionStruct_Jquote_) Witness() m_JSON_Utils_Views_Core.View__ { 262 return Companion_Default___.DOUBLEQUOTE() 263 } 264 265 // End of class Jquote 266 267 func Type_Jquote_() _dafny.TypeDescriptor { 268 return type_Jquote_{} 269 } 270 271 type type_Jquote_ struct { 272 } 273 274 func (_this type_Jquote_) Default() interface{} { 275 return Companion_Jquote_.Witness() 276 } 277 278 func (_this type_Jquote_) String() string { 279 return "JSON_Grammar.Jquote" 280 } 281 282 // Definition of class Jperiod 283 type Jperiod struct { 284 } 285 286 func New_Jperiod_() *Jperiod { 287 _this := Jperiod{} 288 289 return &_this 290 } 291 292 type CompanionStruct_Jperiod_ struct { 293 } 294 295 var Companion_Jperiod_ = CompanionStruct_Jperiod_{} 296 297 func (*Jperiod) String() string { 298 return "JSON_Grammar.Jperiod" 299 } 300 func (_this *CompanionStruct_Jperiod_) Witness() m_JSON_Utils_Views_Core.View__ { 301 return Companion_Default___.PERIOD() 302 } 303 304 // End of class Jperiod 305 306 func Type_Jperiod_() _dafny.TypeDescriptor { 307 return type_Jperiod_{} 308 } 309 310 type type_Jperiod_ struct { 311 } 312 313 func (_this type_Jperiod_) Default() interface{} { 314 return Companion_Jperiod_.Witness() 315 } 316 317 func (_this type_Jperiod_) String() string { 318 return "JSON_Grammar.Jperiod" 319 } 320 321 // Definition of class Je 322 type Je struct { 323 } 324 325 func New_Je_() *Je { 326 _this := Je{} 327 328 return &_this 329 } 330 331 type CompanionStruct_Je_ struct { 332 } 333 334 var Companion_Je_ = CompanionStruct_Je_{} 335 336 func (*Je) String() string { 337 return "JSON_Grammar.Je" 338 } 339 func (_this *CompanionStruct_Je_) Witness() m_JSON_Utils_Views_Core.View__ { 340 return Companion_Default___.E() 341 } 342 343 // End of class Je 344 345 func Type_Je_() _dafny.TypeDescriptor { 346 return type_Je_{} 347 } 348 349 type type_Je_ struct { 350 } 351 352 func (_this type_Je_) Default() interface{} { 353 return Companion_Je_.Witness() 354 } 355 356 func (_this type_Je_) String() string { 357 return "JSON_Grammar.Je" 358 } 359 360 // Definition of class Jcolon 361 type Jcolon struct { 362 } 363 364 func New_Jcolon_() *Jcolon { 365 _this := Jcolon{} 366 367 return &_this 368 } 369 370 type CompanionStruct_Jcolon_ struct { 371 } 372 373 var Companion_Jcolon_ = CompanionStruct_Jcolon_{} 374 375 func (*Jcolon) String() string { 376 return "JSON_Grammar.Jcolon" 377 } 378 func (_this *CompanionStruct_Jcolon_) Witness() m_JSON_Utils_Views_Core.View__ { 379 return Companion_Default___.COLON() 380 } 381 382 // End of class Jcolon 383 384 func Type_Jcolon_() _dafny.TypeDescriptor { 385 return type_Jcolon_{} 386 } 387 388 type type_Jcolon_ struct { 389 } 390 391 func (_this type_Jcolon_) Default() interface{} { 392 return Companion_Jcolon_.Witness() 393 } 394 395 func (_this type_Jcolon_) String() string { 396 return "JSON_Grammar.Jcolon" 397 } 398 399 // Definition of class Jcomma 400 type Jcomma struct { 401 } 402 403 func New_Jcomma_() *Jcomma { 404 _this := Jcomma{} 405 406 return &_this 407 } 408 409 type CompanionStruct_Jcomma_ struct { 410 } 411 412 var Companion_Jcomma_ = CompanionStruct_Jcomma_{} 413 414 func (*Jcomma) String() string { 415 return "JSON_Grammar.Jcomma" 416 } 417 func (_this *CompanionStruct_Jcomma_) Witness() m_JSON_Utils_Views_Core.View__ { 418 return Companion_Default___.COMMA() 419 } 420 421 // End of class Jcomma 422 423 func Type_Jcomma_() _dafny.TypeDescriptor { 424 return type_Jcomma_{} 425 } 426 427 type type_Jcomma_ struct { 428 } 429 430 func (_this type_Jcomma_) Default() interface{} { 431 return Companion_Jcomma_.Witness() 432 } 433 434 func (_this type_Jcomma_) String() string { 435 return "JSON_Grammar.Jcomma" 436 } 437 438 // Definition of class Jlbrace 439 type Jlbrace struct { 440 } 441 442 func New_Jlbrace_() *Jlbrace { 443 _this := Jlbrace{} 444 445 return &_this 446 } 447 448 type CompanionStruct_Jlbrace_ struct { 449 } 450 451 var Companion_Jlbrace_ = CompanionStruct_Jlbrace_{} 452 453 func (*Jlbrace) String() string { 454 return "JSON_Grammar.Jlbrace" 455 } 456 func (_this *CompanionStruct_Jlbrace_) Witness() m_JSON_Utils_Views_Core.View__ { 457 return Companion_Default___.LBRACE() 458 } 459 460 // End of class Jlbrace 461 462 func Type_Jlbrace_() _dafny.TypeDescriptor { 463 return type_Jlbrace_{} 464 } 465 466 type type_Jlbrace_ struct { 467 } 468 469 func (_this type_Jlbrace_) Default() interface{} { 470 return Companion_Jlbrace_.Witness() 471 } 472 473 func (_this type_Jlbrace_) String() string { 474 return "JSON_Grammar.Jlbrace" 475 } 476 477 // Definition of class Jrbrace 478 type Jrbrace struct { 479 } 480 481 func New_Jrbrace_() *Jrbrace { 482 _this := Jrbrace{} 483 484 return &_this 485 } 486 487 type CompanionStruct_Jrbrace_ struct { 488 } 489 490 var Companion_Jrbrace_ = CompanionStruct_Jrbrace_{} 491 492 func (*Jrbrace) String() string { 493 return "JSON_Grammar.Jrbrace" 494 } 495 func (_this *CompanionStruct_Jrbrace_) Witness() m_JSON_Utils_Views_Core.View__ { 496 return Companion_Default___.RBRACE() 497 } 498 499 // End of class Jrbrace 500 501 func Type_Jrbrace_() _dafny.TypeDescriptor { 502 return type_Jrbrace_{} 503 } 504 505 type type_Jrbrace_ struct { 506 } 507 508 func (_this type_Jrbrace_) Default() interface{} { 509 return Companion_Jrbrace_.Witness() 510 } 511 512 func (_this type_Jrbrace_) String() string { 513 return "JSON_Grammar.Jrbrace" 514 } 515 516 // Definition of class Jlbracket 517 type Jlbracket struct { 518 } 519 520 func New_Jlbracket_() *Jlbracket { 521 _this := Jlbracket{} 522 523 return &_this 524 } 525 526 type CompanionStruct_Jlbracket_ struct { 527 } 528 529 var Companion_Jlbracket_ = CompanionStruct_Jlbracket_{} 530 531 func (*Jlbracket) String() string { 532 return "JSON_Grammar.Jlbracket" 533 } 534 func (_this *CompanionStruct_Jlbracket_) Witness() m_JSON_Utils_Views_Core.View__ { 535 return Companion_Default___.LBRACKET() 536 } 537 538 // End of class Jlbracket 539 540 func Type_Jlbracket_() _dafny.TypeDescriptor { 541 return type_Jlbracket_{} 542 } 543 544 type type_Jlbracket_ struct { 545 } 546 547 func (_this type_Jlbracket_) Default() interface{} { 548 return Companion_Jlbracket_.Witness() 549 } 550 551 func (_this type_Jlbracket_) String() string { 552 return "JSON_Grammar.Jlbracket" 553 } 554 555 // Definition of class Jrbracket 556 type Jrbracket struct { 557 } 558 559 func New_Jrbracket_() *Jrbracket { 560 _this := Jrbracket{} 561 562 return &_this 563 } 564 565 type CompanionStruct_Jrbracket_ struct { 566 } 567 568 var Companion_Jrbracket_ = CompanionStruct_Jrbracket_{} 569 570 func (*Jrbracket) String() string { 571 return "JSON_Grammar.Jrbracket" 572 } 573 func (_this *CompanionStruct_Jrbracket_) Witness() m_JSON_Utils_Views_Core.View__ { 574 return Companion_Default___.RBRACKET() 575 } 576 577 // End of class Jrbracket 578 579 func Type_Jrbracket_() _dafny.TypeDescriptor { 580 return type_Jrbracket_{} 581 } 582 583 type type_Jrbracket_ struct { 584 } 585 586 func (_this type_Jrbracket_) Default() interface{} { 587 return Companion_Jrbracket_.Witness() 588 } 589 590 func (_this type_Jrbracket_) String() string { 591 return "JSON_Grammar.Jrbracket" 592 } 593 594 // Definition of class Jminus 595 type Jminus struct { 596 } 597 598 func New_Jminus_() *Jminus { 599 _this := Jminus{} 600 601 return &_this 602 } 603 604 type CompanionStruct_Jminus_ struct { 605 } 606 607 var Companion_Jminus_ = CompanionStruct_Jminus_{} 608 609 func (*Jminus) String() string { 610 return "JSON_Grammar.Jminus" 611 } 612 func (_this *CompanionStruct_Jminus_) Witness() m_JSON_Utils_Views_Core.View__ { 613 return Companion_Default___.MINUS() 614 } 615 616 // End of class Jminus 617 618 func Type_Jminus_() _dafny.TypeDescriptor { 619 return type_Jminus_{} 620 } 621 622 type type_Jminus_ struct { 623 } 624 625 func (_this type_Jminus_) Default() interface{} { 626 return Companion_Jminus_.Witness() 627 } 628 629 func (_this type_Jminus_) String() string { 630 return "JSON_Grammar.Jminus" 631 } 632 633 // Definition of class Jsign 634 type Jsign struct { 635 } 636 637 func New_Jsign_() *Jsign { 638 _this := Jsign{} 639 640 return &_this 641 } 642 643 type CompanionStruct_Jsign_ struct { 644 } 645 646 var Companion_Jsign_ = CompanionStruct_Jsign_{} 647 648 func (*Jsign) String() string { 649 return "JSON_Grammar.Jsign" 650 } 651 func (_this *CompanionStruct_Jsign_) Witness() m_JSON_Utils_Views_Core.View__ { 652 return Companion_Default___.EMPTY() 653 } 654 655 // End of class Jsign 656 657 func Type_Jsign_() _dafny.TypeDescriptor { 658 return type_Jsign_{} 659 } 660 661 type type_Jsign_ struct { 662 } 663 664 func (_this type_Jsign_) Default() interface{} { 665 return Companion_Jsign_.Witness() 666 } 667 668 func (_this type_Jsign_) String() string { 669 return "JSON_Grammar.Jsign" 670 } 671 672 // Definition of class Jblanks 673 type Jblanks struct { 674 } 675 676 func New_Jblanks_() *Jblanks { 677 _this := Jblanks{} 678 679 return &_this 680 } 681 682 type CompanionStruct_Jblanks_ struct { 683 } 684 685 var Companion_Jblanks_ = CompanionStruct_Jblanks_{} 686 687 func (*Jblanks) String() string { 688 return "JSON_Grammar.Jblanks" 689 } 690 func (_this *CompanionStruct_Jblanks_) Witness() m_JSON_Utils_Views_Core.View__ { 691 return m_JSON_Utils_Views_Core.Companion_View___.OfBytes(_dafny.SeqOf()) 692 } 693 694 // End of class Jblanks 695 696 func Type_Jblanks_() _dafny.TypeDescriptor { 697 return type_Jblanks_{} 698 } 699 700 type type_Jblanks_ struct { 701 } 702 703 func (_this type_Jblanks_) Default() interface{} { 704 return Companion_Jblanks_.Witness() 705 } 706 707 func (_this type_Jblanks_) String() string { 708 return "JSON_Grammar.Jblanks" 709 } 710 711 // Definition of datatype Structural 712 type Structural struct { 713 Data_Structural_ 714 } 715 716 func (_this Structural) Get_() Data_Structural_ { 717 return _this.Data_Structural_ 718 } 719 720 type Data_Structural_ interface { 721 isStructural() 722 } 723 724 type CompanionStruct_Structural_ struct { 725 } 726 727 var Companion_Structural_ = CompanionStruct_Structural_{} 728 729 type Structural_Structural struct { 730 Before m_JSON_Utils_Views_Core.View__ 731 T interface{} 732 After m_JSON_Utils_Views_Core.View__ 733 } 734 735 func (Structural_Structural) isStructural() {} 736 737 func (CompanionStruct_Structural_) Create_Structural_(Before m_JSON_Utils_Views_Core.View__, T interface{}, After m_JSON_Utils_Views_Core.View__) Structural { 738 return Structural{Structural_Structural{Before, T, After}} 739 } 740 741 func (_this Structural) Is_Structural() bool { 742 _, ok := _this.Get_().(Structural_Structural) 743 return ok 744 } 745 746 func (CompanionStruct_Structural_) Default(_default_T interface{}) Structural { 747 return Companion_Structural_.Create_Structural_(Companion_Jblanks_.Witness(), _default_T, Companion_Jblanks_.Witness()) 748 } 749 750 func (_this Structural) Dtor_before() m_JSON_Utils_Views_Core.View__ { 751 return _this.Get_().(Structural_Structural).Before 752 } 753 754 func (_this Structural) Dtor_t() interface{} { 755 return _this.Get_().(Structural_Structural).T 756 } 757 758 func (_this Structural) Dtor_after() m_JSON_Utils_Views_Core.View__ { 759 return _this.Get_().(Structural_Structural).After 760 } 761 762 func (_this Structural) String() string { 763 switch data := _this.Get_().(type) { 764 case nil: 765 return "null" 766 case Structural_Structural: 767 { 768 return "Grammar.Structural.Structural" + "(" + _dafny.String(data.Before) + ", " + _dafny.String(data.T) + ", " + _dafny.String(data.After) + ")" 769 } 770 default: 771 { 772 return "<unexpected>" 773 } 774 } 775 } 776 777 func (_this Structural) Equals(other Structural) bool { 778 switch data1 := _this.Get_().(type) { 779 case Structural_Structural: 780 { 781 data2, ok := other.Get_().(Structural_Structural) 782 return ok && data1.Before.Equals(data2.Before) && _dafny.AreEqual(data1.T, data2.T) && data1.After.Equals(data2.After) 783 } 784 default: 785 { 786 return false // unexpected 787 } 788 } 789 } 790 791 func (_this Structural) EqualsGeneric(other interface{}) bool { 792 typed, ok := other.(Structural) 793 return ok && _this.Equals(typed) 794 } 795 796 func Type_Structural_(Type_T_ _dafny.TypeDescriptor) _dafny.TypeDescriptor { 797 return type_Structural_{Type_T_} 798 } 799 800 type type_Structural_ struct { 801 Type_T_ _dafny.TypeDescriptor 802 } 803 804 func (_this type_Structural_) Default() interface{} { 805 Type_T_ := _this.Type_T_ 806 _ = Type_T_ 807 return Companion_Structural_.Default(Type_T_.Default()) 808 } 809 810 func (_this type_Structural_) String() string { 811 return "JSON_Grammar.Structural" 812 } 813 func (_this Structural) ParentTraits_() []*_dafny.TraitID { 814 return [](*_dafny.TraitID){} 815 } 816 817 var _ _dafny.TraitOffspring = Structural{} 818 819 // End of datatype Structural 820 821 // Definition of datatype Maybe 822 type Maybe struct { 823 Data_Maybe_ 824 } 825 826 func (_this Maybe) Get_() Data_Maybe_ { 827 return _this.Data_Maybe_ 828 } 829 830 type Data_Maybe_ interface { 831 isMaybe() 832 } 833 834 type CompanionStruct_Maybe_ struct { 835 } 836 837 var Companion_Maybe_ = CompanionStruct_Maybe_{} 838 839 type Maybe_Empty struct { 840 } 841 842 func (Maybe_Empty) isMaybe() {} 843 844 func (CompanionStruct_Maybe_) Create_Empty_() Maybe { 845 return Maybe{Maybe_Empty{}} 846 } 847 848 func (_this Maybe) Is_Empty() bool { 849 _, ok := _this.Get_().(Maybe_Empty) 850 return ok 851 } 852 853 type Maybe_NonEmpty struct { 854 T interface{} 855 } 856 857 func (Maybe_NonEmpty) isMaybe() {} 858 859 func (CompanionStruct_Maybe_) Create_NonEmpty_(T interface{}) Maybe { 860 return Maybe{Maybe_NonEmpty{T}} 861 } 862 863 func (_this Maybe) Is_NonEmpty() bool { 864 _, ok := _this.Get_().(Maybe_NonEmpty) 865 return ok 866 } 867 868 func (CompanionStruct_Maybe_) Default() Maybe { 869 return Companion_Maybe_.Create_Empty_() 870 } 871 872 func (_this Maybe) Dtor_t() interface{} { 873 return _this.Get_().(Maybe_NonEmpty).T 874 } 875 876 func (_this Maybe) String() string { 877 switch data := _this.Get_().(type) { 878 case nil: 879 return "null" 880 case Maybe_Empty: 881 { 882 return "Grammar.Maybe.Empty" 883 } 884 case Maybe_NonEmpty: 885 { 886 return "Grammar.Maybe.NonEmpty" + "(" + _dafny.String(data.T) + ")" 887 } 888 default: 889 { 890 return "<unexpected>" 891 } 892 } 893 } 894 895 func (_this Maybe) Equals(other Maybe) bool { 896 switch data1 := _this.Get_().(type) { 897 case Maybe_Empty: 898 { 899 _, ok := other.Get_().(Maybe_Empty) 900 return ok 901 } 902 case Maybe_NonEmpty: 903 { 904 data2, ok := other.Get_().(Maybe_NonEmpty) 905 return ok && _dafny.AreEqual(data1.T, data2.T) 906 } 907 default: 908 { 909 return false // unexpected 910 } 911 } 912 } 913 914 func (_this Maybe) EqualsGeneric(other interface{}) bool { 915 typed, ok := other.(Maybe) 916 return ok && _this.Equals(typed) 917 } 918 919 func Type_Maybe_() _dafny.TypeDescriptor { 920 return type_Maybe_{} 921 } 922 923 type type_Maybe_ struct { 924 } 925 926 func (_this type_Maybe_) Default() interface{} { 927 return Companion_Maybe_.Default() 928 } 929 930 func (_this type_Maybe_) String() string { 931 return "JSON_Grammar.Maybe" 932 } 933 func (_this Maybe) ParentTraits_() []*_dafny.TraitID { 934 return [](*_dafny.TraitID){} 935 } 936 937 var _ _dafny.TraitOffspring = Maybe{} 938 939 // End of datatype Maybe 940 941 // Definition of datatype Suffixed 942 type Suffixed struct { 943 Data_Suffixed_ 944 } 945 946 func (_this Suffixed) Get_() Data_Suffixed_ { 947 return _this.Data_Suffixed_ 948 } 949 950 type Data_Suffixed_ interface { 951 isSuffixed() 952 } 953 954 type CompanionStruct_Suffixed_ struct { 955 } 956 957 var Companion_Suffixed_ = CompanionStruct_Suffixed_{} 958 959 type Suffixed_Suffixed struct { 960 T interface{} 961 Suffix Maybe 962 } 963 964 func (Suffixed_Suffixed) isSuffixed() {} 965 966 func (CompanionStruct_Suffixed_) Create_Suffixed_(T interface{}, Suffix Maybe) Suffixed { 967 return Suffixed{Suffixed_Suffixed{T, Suffix}} 968 } 969 970 func (_this Suffixed) Is_Suffixed() bool { 971 _, ok := _this.Get_().(Suffixed_Suffixed) 972 return ok 973 } 974 975 func (CompanionStruct_Suffixed_) Default(_default_T interface{}) Suffixed { 976 return Companion_Suffixed_.Create_Suffixed_(_default_T, Companion_Maybe_.Default()) 977 } 978 979 func (_this Suffixed) Dtor_t() interface{} { 980 return _this.Get_().(Suffixed_Suffixed).T 981 } 982 983 func (_this Suffixed) Dtor_suffix() Maybe { 984 return _this.Get_().(Suffixed_Suffixed).Suffix 985 } 986 987 func (_this Suffixed) String() string { 988 switch data := _this.Get_().(type) { 989 case nil: 990 return "null" 991 case Suffixed_Suffixed: 992 { 993 return "Grammar.Suffixed.Suffixed" + "(" + _dafny.String(data.T) + ", " + _dafny.String(data.Suffix) + ")" 994 } 995 default: 996 { 997 return "<unexpected>" 998 } 999 } 1000 } 1001 1002 func (_this Suffixed) Equals(other Suffixed) bool { 1003 switch data1 := _this.Get_().(type) { 1004 case Suffixed_Suffixed: 1005 { 1006 data2, ok := other.Get_().(Suffixed_Suffixed) 1007 return ok && _dafny.AreEqual(data1.T, data2.T) && data1.Suffix.Equals(data2.Suffix) 1008 } 1009 default: 1010 { 1011 return false // unexpected 1012 } 1013 } 1014 } 1015 1016 func (_this Suffixed) EqualsGeneric(other interface{}) bool { 1017 typed, ok := other.(Suffixed) 1018 return ok && _this.Equals(typed) 1019 } 1020 1021 func Type_Suffixed_(Type_T_ _dafny.TypeDescriptor) _dafny.TypeDescriptor { 1022 return type_Suffixed_{Type_T_} 1023 } 1024 1025 type type_Suffixed_ struct { 1026 Type_T_ _dafny.TypeDescriptor 1027 } 1028 1029 func (_this type_Suffixed_) Default() interface{} { 1030 Type_T_ := _this.Type_T_ 1031 _ = Type_T_ 1032 return Companion_Suffixed_.Default(Type_T_.Default()) 1033 } 1034 1035 func (_this type_Suffixed_) String() string { 1036 return "JSON_Grammar.Suffixed" 1037 } 1038 func (_this Suffixed) ParentTraits_() []*_dafny.TraitID { 1039 return [](*_dafny.TraitID){} 1040 } 1041 1042 var _ _dafny.TraitOffspring = Suffixed{} 1043 1044 // End of datatype Suffixed 1045 1046 // Definition of class SuffixedSequence 1047 type SuffixedSequence struct { 1048 } 1049 1050 func New_SuffixedSequence_() *SuffixedSequence { 1051 _this := SuffixedSequence{} 1052 1053 return &_this 1054 } 1055 1056 type CompanionStruct_SuffixedSequence_ struct { 1057 } 1058 1059 var Companion_SuffixedSequence_ = CompanionStruct_SuffixedSequence_{} 1060 1061 func (*SuffixedSequence) String() string { 1062 return "JSON_Grammar.SuffixedSequence" 1063 } 1064 1065 // End of class SuffixedSequence 1066 1067 func Type_SuffixedSequence_(Type_D_ _dafny.TypeDescriptor, Type_S_ _dafny.TypeDescriptor) _dafny.TypeDescriptor { 1068 return type_SuffixedSequence_{Type_D_, Type_S_} 1069 } 1070 1071 type type_SuffixedSequence_ struct { 1072 Type_D_ _dafny.TypeDescriptor 1073 Type_S_ _dafny.TypeDescriptor 1074 } 1075 1076 func (_this type_SuffixedSequence_) Default() interface{} { 1077 Type_D_ := _this.Type_D_ 1078 _ = Type_D_ 1079 Type_S_ := _this.Type_S_ 1080 _ = Type_S_ 1081 return _dafny.EmptySeq 1082 } 1083 1084 func (_this type_SuffixedSequence_) String() string { 1085 return "JSON_Grammar.SuffixedSequence" 1086 } 1087 1088 // Definition of datatype Bracketed 1089 type Bracketed struct { 1090 Data_Bracketed_ 1091 } 1092 1093 func (_this Bracketed) Get_() Data_Bracketed_ { 1094 return _this.Data_Bracketed_ 1095 } 1096 1097 type Data_Bracketed_ interface { 1098 isBracketed() 1099 } 1100 1101 type CompanionStruct_Bracketed_ struct { 1102 } 1103 1104 var Companion_Bracketed_ = CompanionStruct_Bracketed_{} 1105 1106 type Bracketed_Bracketed struct { 1107 L Structural 1108 Data _dafny.Sequence 1109 R Structural 1110 } 1111 1112 func (Bracketed_Bracketed) isBracketed() {} 1113 1114 func (CompanionStruct_Bracketed_) Create_Bracketed_(L Structural, Data _dafny.Sequence, R Structural) Bracketed { 1115 return Bracketed{Bracketed_Bracketed{L, Data, R}} 1116 } 1117 1118 func (_this Bracketed) Is_Bracketed() bool { 1119 _, ok := _this.Get_().(Bracketed_Bracketed) 1120 return ok 1121 } 1122 1123 func (CompanionStruct_Bracketed_) Default(_default_L interface{}, _default_R interface{}) Bracketed { 1124 return Companion_Bracketed_.Create_Bracketed_(Companion_Structural_.Default(_default_L), _dafny.EmptySeq, Companion_Structural_.Default(_default_R)) 1125 } 1126 1127 func (_this Bracketed) Dtor_l() Structural { 1128 return _this.Get_().(Bracketed_Bracketed).L 1129 } 1130 1131 func (_this Bracketed) Dtor_data() _dafny.Sequence { 1132 return _this.Get_().(Bracketed_Bracketed).Data 1133 } 1134 1135 func (_this Bracketed) Dtor_r() Structural { 1136 return _this.Get_().(Bracketed_Bracketed).R 1137 } 1138 1139 func (_this Bracketed) String() string { 1140 switch data := _this.Get_().(type) { 1141 case nil: 1142 return "null" 1143 case Bracketed_Bracketed: 1144 { 1145 return "Grammar.Bracketed.Bracketed" + "(" + _dafny.String(data.L) + ", " + _dafny.String(data.Data) + ", " + _dafny.String(data.R) + ")" 1146 } 1147 default: 1148 { 1149 return "<unexpected>" 1150 } 1151 } 1152 } 1153 1154 func (_this Bracketed) Equals(other Bracketed) bool { 1155 switch data1 := _this.Get_().(type) { 1156 case Bracketed_Bracketed: 1157 { 1158 data2, ok := other.Get_().(Bracketed_Bracketed) 1159 return ok && data1.L.Equals(data2.L) && data1.Data.Equals(data2.Data) && data1.R.Equals(data2.R) 1160 } 1161 default: 1162 { 1163 return false // unexpected 1164 } 1165 } 1166 } 1167 1168 func (_this Bracketed) EqualsGeneric(other interface{}) bool { 1169 typed, ok := other.(Bracketed) 1170 return ok && _this.Equals(typed) 1171 } 1172 1173 func Type_Bracketed_(Type_L_ _dafny.TypeDescriptor, Type_R_ _dafny.TypeDescriptor) _dafny.TypeDescriptor { 1174 return type_Bracketed_{Type_L_, Type_R_} 1175 } 1176 1177 type type_Bracketed_ struct { 1178 Type_L_ _dafny.TypeDescriptor 1179 Type_R_ _dafny.TypeDescriptor 1180 } 1181 1182 func (_this type_Bracketed_) Default() interface{} { 1183 Type_L_ := _this.Type_L_ 1184 _ = Type_L_ 1185 Type_R_ := _this.Type_R_ 1186 _ = Type_R_ 1187 return Companion_Bracketed_.Default(Type_L_.Default(), Type_R_.Default()) 1188 } 1189 1190 func (_this type_Bracketed_) String() string { 1191 return "JSON_Grammar.Bracketed" 1192 } 1193 func (_this Bracketed) ParentTraits_() []*_dafny.TraitID { 1194 return [](*_dafny.TraitID){} 1195 } 1196 1197 var _ _dafny.TraitOffspring = Bracketed{} 1198 1199 // End of datatype Bracketed 1200 1201 // Definition of class Jnull 1202 type Jnull struct { 1203 } 1204 1205 func New_Jnull_() *Jnull { 1206 _this := Jnull{} 1207 1208 return &_this 1209 } 1210 1211 type CompanionStruct_Jnull_ struct { 1212 } 1213 1214 var Companion_Jnull_ = CompanionStruct_Jnull_{} 1215 1216 func (*Jnull) String() string { 1217 return "JSON_Grammar.Jnull" 1218 } 1219 func (_this *CompanionStruct_Jnull_) Witness() m_JSON_Utils_Views_Core.View__ { 1220 return m_JSON_Utils_Views_Core.Companion_View___.OfBytes(Companion_Default___.NULL()) 1221 } 1222 1223 // End of class Jnull 1224 1225 func Type_Jnull_() _dafny.TypeDescriptor { 1226 return type_Jnull_{} 1227 } 1228 1229 type type_Jnull_ struct { 1230 } 1231 1232 func (_this type_Jnull_) Default() interface{} { 1233 return Companion_Jnull_.Witness() 1234 } 1235 1236 func (_this type_Jnull_) String() string { 1237 return "JSON_Grammar.Jnull" 1238 } 1239 1240 // Definition of class Jbool 1241 type Jbool struct { 1242 } 1243 1244 func New_Jbool_() *Jbool { 1245 _this := Jbool{} 1246 1247 return &_this 1248 } 1249 1250 type CompanionStruct_Jbool_ struct { 1251 } 1252 1253 var Companion_Jbool_ = CompanionStruct_Jbool_{} 1254 1255 func (*Jbool) String() string { 1256 return "JSON_Grammar.Jbool" 1257 } 1258 func (_this *CompanionStruct_Jbool_) Witness() m_JSON_Utils_Views_Core.View__ { 1259 return m_JSON_Utils_Views_Core.Companion_View___.OfBytes(Companion_Default___.TRUE()) 1260 } 1261 1262 // End of class Jbool 1263 1264 func Type_Jbool_() _dafny.TypeDescriptor { 1265 return type_Jbool_{} 1266 } 1267 1268 type type_Jbool_ struct { 1269 } 1270 1271 func (_this type_Jbool_) Default() interface{} { 1272 return Companion_Jbool_.Witness() 1273 } 1274 1275 func (_this type_Jbool_) String() string { 1276 return "JSON_Grammar.Jbool" 1277 } 1278 1279 // Definition of class Jdigits 1280 type Jdigits struct { 1281 } 1282 1283 func New_Jdigits_() *Jdigits { 1284 _this := Jdigits{} 1285 1286 return &_this 1287 } 1288 1289 type CompanionStruct_Jdigits_ struct { 1290 } 1291 1292 var Companion_Jdigits_ = CompanionStruct_Jdigits_{} 1293 1294 func (*Jdigits) String() string { 1295 return "JSON_Grammar.Jdigits" 1296 } 1297 func (_this *CompanionStruct_Jdigits_) Witness() m_JSON_Utils_Views_Core.View__ { 1298 return m_JSON_Utils_Views_Core.Companion_View___.OfBytes(_dafny.SeqOf()) 1299 } 1300 1301 // End of class Jdigits 1302 1303 func Type_Jdigits_() _dafny.TypeDescriptor { 1304 return type_Jdigits_{} 1305 } 1306 1307 type type_Jdigits_ struct { 1308 } 1309 1310 func (_this type_Jdigits_) Default() interface{} { 1311 return Companion_Jdigits_.Witness() 1312 } 1313 1314 func (_this type_Jdigits_) String() string { 1315 return "JSON_Grammar.Jdigits" 1316 } 1317 1318 // Definition of class Jnum 1319 type Jnum struct { 1320 } 1321 1322 func New_Jnum_() *Jnum { 1323 _this := Jnum{} 1324 1325 return &_this 1326 } 1327 1328 type CompanionStruct_Jnum_ struct { 1329 } 1330 1331 var Companion_Jnum_ = CompanionStruct_Jnum_{} 1332 1333 func (*Jnum) String() string { 1334 return "JSON_Grammar.Jnum" 1335 } 1336 func (_this *CompanionStruct_Jnum_) Witness() m_JSON_Utils_Views_Core.View__ { 1337 return m_JSON_Utils_Views_Core.Companion_View___.OfBytes(_dafny.SeqOf(uint8(_dafny.Char('0')))) 1338 } 1339 1340 // End of class Jnum 1341 1342 func Type_Jnum_() _dafny.TypeDescriptor { 1343 return type_Jnum_{} 1344 } 1345 1346 type type_Jnum_ struct { 1347 } 1348 1349 func (_this type_Jnum_) Default() interface{} { 1350 return Companion_Jnum_.Witness() 1351 } 1352 1353 func (_this type_Jnum_) String() string { 1354 return "JSON_Grammar.Jnum" 1355 } 1356 1357 // Definition of class Jint 1358 type Jint struct { 1359 } 1360 1361 func New_Jint_() *Jint { 1362 _this := Jint{} 1363 1364 return &_this 1365 } 1366 1367 type CompanionStruct_Jint_ struct { 1368 } 1369 1370 var Companion_Jint_ = CompanionStruct_Jint_{} 1371 1372 func (*Jint) String() string { 1373 return "JSON_Grammar.Jint" 1374 } 1375 func (_this *CompanionStruct_Jint_) Witness() m_JSON_Utils_Views_Core.View__ { 1376 return m_JSON_Utils_Views_Core.Companion_View___.OfBytes(_dafny.SeqOf(uint8(_dafny.Char('0')))) 1377 } 1378 1379 // End of class Jint 1380 1381 func Type_Jint_() _dafny.TypeDescriptor { 1382 return type_Jint_{} 1383 } 1384 1385 type type_Jint_ struct { 1386 } 1387 1388 func (_this type_Jint_) Default() interface{} { 1389 return Companion_Jint_.Witness() 1390 } 1391 1392 func (_this type_Jint_) String() string { 1393 return "JSON_Grammar.Jint" 1394 } 1395 1396 // Definition of class Jstr 1397 type Jstr struct { 1398 } 1399 1400 func New_Jstr_() *Jstr { 1401 _this := Jstr{} 1402 1403 return &_this 1404 } 1405 1406 type CompanionStruct_Jstr_ struct { 1407 } 1408 1409 var Companion_Jstr_ = CompanionStruct_Jstr_{} 1410 1411 func (*Jstr) String() string { 1412 return "JSON_Grammar.Jstr" 1413 } 1414 func (_this *CompanionStruct_Jstr_) Witness() m_JSON_Utils_Views_Core.View__ { 1415 return m_JSON_Utils_Views_Core.Companion_View___.OfBytes(_dafny.SeqOf()) 1416 } 1417 1418 // End of class Jstr 1419 1420 func Type_Jstr_() _dafny.TypeDescriptor { 1421 return type_Jstr_{} 1422 } 1423 1424 type type_Jstr_ struct { 1425 } 1426 1427 func (_this type_Jstr_) Default() interface{} { 1428 return Companion_Jstr_.Witness() 1429 } 1430 1431 func (_this type_Jstr_) String() string { 1432 return "JSON_Grammar.Jstr" 1433 } 1434 1435 // Definition of datatype Jstring 1436 type Jstring struct { 1437 Data_Jstring_ 1438 } 1439 1440 func (_this Jstring) Get_() Data_Jstring_ { 1441 return _this.Data_Jstring_ 1442 } 1443 1444 type Data_Jstring_ interface { 1445 isJstring() 1446 } 1447 1448 type CompanionStruct_Jstring_ struct { 1449 } 1450 1451 var Companion_Jstring_ = CompanionStruct_Jstring_{} 1452 1453 type Jstring_JString struct { 1454 Lq m_JSON_Utils_Views_Core.View__ 1455 Contents m_JSON_Utils_Views_Core.View__ 1456 Rq m_JSON_Utils_Views_Core.View__ 1457 } 1458 1459 func (Jstring_JString) isJstring() {} 1460 1461 func (CompanionStruct_Jstring_) Create_JString_(Lq m_JSON_Utils_Views_Core.View__, Contents m_JSON_Utils_Views_Core.View__, Rq m_JSON_Utils_Views_Core.View__) Jstring { 1462 return Jstring{Jstring_JString{Lq, Contents, Rq}} 1463 } 1464 1465 func (_this Jstring) Is_JString() bool { 1466 _, ok := _this.Get_().(Jstring_JString) 1467 return ok 1468 } 1469 1470 func (CompanionStruct_Jstring_) Default() Jstring { 1471 return Companion_Jstring_.Create_JString_(Companion_Jquote_.Witness(), Companion_Jstr_.Witness(), Companion_Jquote_.Witness()) 1472 } 1473 1474 func (_this Jstring) Dtor_lq() m_JSON_Utils_Views_Core.View__ { 1475 return _this.Get_().(Jstring_JString).Lq 1476 } 1477 1478 func (_this Jstring) Dtor_contents() m_JSON_Utils_Views_Core.View__ { 1479 return _this.Get_().(Jstring_JString).Contents 1480 } 1481 1482 func (_this Jstring) Dtor_rq() m_JSON_Utils_Views_Core.View__ { 1483 return _this.Get_().(Jstring_JString).Rq 1484 } 1485 1486 func (_this Jstring) String() string { 1487 switch data := _this.Get_().(type) { 1488 case nil: 1489 return "null" 1490 case Jstring_JString: 1491 { 1492 return "Grammar.jstring.JString" + "(" + _dafny.String(data.Lq) + ", " + _dafny.String(data.Contents) + ", " + _dafny.String(data.Rq) + ")" 1493 } 1494 default: 1495 { 1496 return "<unexpected>" 1497 } 1498 } 1499 } 1500 1501 func (_this Jstring) Equals(other Jstring) bool { 1502 switch data1 := _this.Get_().(type) { 1503 case Jstring_JString: 1504 { 1505 data2, ok := other.Get_().(Jstring_JString) 1506 return ok && data1.Lq.Equals(data2.Lq) && data1.Contents.Equals(data2.Contents) && data1.Rq.Equals(data2.Rq) 1507 } 1508 default: 1509 { 1510 return false // unexpected 1511 } 1512 } 1513 } 1514 1515 func (_this Jstring) EqualsGeneric(other interface{}) bool { 1516 typed, ok := other.(Jstring) 1517 return ok && _this.Equals(typed) 1518 } 1519 1520 func Type_Jstring_() _dafny.TypeDescriptor { 1521 return type_Jstring_{} 1522 } 1523 1524 type type_Jstring_ struct { 1525 } 1526 1527 func (_this type_Jstring_) Default() interface{} { 1528 return Companion_Jstring_.Default() 1529 } 1530 1531 func (_this type_Jstring_) String() string { 1532 return "JSON_Grammar.Jstring" 1533 } 1534 func (_this Jstring) ParentTraits_() []*_dafny.TraitID { 1535 return [](*_dafny.TraitID){} 1536 } 1537 1538 var _ _dafny.TraitOffspring = Jstring{} 1539 1540 // End of datatype Jstring 1541 1542 // Definition of datatype JKeyValue 1543 type JKeyValue struct { 1544 Data_JKeyValue_ 1545 } 1546 1547 func (_this JKeyValue) Get_() Data_JKeyValue_ { 1548 return _this.Data_JKeyValue_ 1549 } 1550 1551 type Data_JKeyValue_ interface { 1552 isJKeyValue() 1553 } 1554 1555 type CompanionStruct_JKeyValue_ struct { 1556 } 1557 1558 var Companion_JKeyValue_ = CompanionStruct_JKeyValue_{} 1559 1560 type JKeyValue_KeyValue struct { 1561 K Jstring 1562 Colon Structural 1563 V Value 1564 } 1565 1566 func (JKeyValue_KeyValue) isJKeyValue() {} 1567 1568 func (CompanionStruct_JKeyValue_) Create_KeyValue_(K Jstring, Colon Structural, V Value) JKeyValue { 1569 return JKeyValue{JKeyValue_KeyValue{K, Colon, V}} 1570 } 1571 1572 func (_this JKeyValue) Is_KeyValue() bool { 1573 _, ok := _this.Get_().(JKeyValue_KeyValue) 1574 return ok 1575 } 1576 1577 func (CompanionStruct_JKeyValue_) Default() JKeyValue { 1578 return Companion_JKeyValue_.Create_KeyValue_(Companion_Jstring_.Default(), Companion_Structural_.Default(Companion_Jcolon_.Witness()), Companion_Value_.Default()) 1579 } 1580 1581 func (_this JKeyValue) Dtor_k() Jstring { 1582 return _this.Get_().(JKeyValue_KeyValue).K 1583 } 1584 1585 func (_this JKeyValue) Dtor_colon() Structural { 1586 return _this.Get_().(JKeyValue_KeyValue).Colon 1587 } 1588 1589 func (_this JKeyValue) Dtor_v() Value { 1590 return _this.Get_().(JKeyValue_KeyValue).V 1591 } 1592 1593 func (_this JKeyValue) String() string { 1594 switch data := _this.Get_().(type) { 1595 case nil: 1596 return "null" 1597 case JKeyValue_KeyValue: 1598 { 1599 return "Grammar.jKeyValue.KeyValue" + "(" + _dafny.String(data.K) + ", " + _dafny.String(data.Colon) + ", " + _dafny.String(data.V) + ")" 1600 } 1601 default: 1602 { 1603 return "<unexpected>" 1604 } 1605 } 1606 } 1607 1608 func (_this JKeyValue) Equals(other JKeyValue) bool { 1609 switch data1 := _this.Get_().(type) { 1610 case JKeyValue_KeyValue: 1611 { 1612 data2, ok := other.Get_().(JKeyValue_KeyValue) 1613 return ok && data1.K.Equals(data2.K) && data1.Colon.Equals(data2.Colon) && data1.V.Equals(data2.V) 1614 } 1615 default: 1616 { 1617 return false // unexpected 1618 } 1619 } 1620 } 1621 1622 func (_this JKeyValue) EqualsGeneric(other interface{}) bool { 1623 typed, ok := other.(JKeyValue) 1624 return ok && _this.Equals(typed) 1625 } 1626 1627 func Type_JKeyValue_() _dafny.TypeDescriptor { 1628 return type_JKeyValue_{} 1629 } 1630 1631 type type_JKeyValue_ struct { 1632 } 1633 1634 func (_this type_JKeyValue_) Default() interface{} { 1635 return Companion_JKeyValue_.Default() 1636 } 1637 1638 func (_this type_JKeyValue_) String() string { 1639 return "JSON_Grammar.JKeyValue" 1640 } 1641 func (_this JKeyValue) ParentTraits_() []*_dafny.TraitID { 1642 return [](*_dafny.TraitID){} 1643 } 1644 1645 var _ _dafny.TraitOffspring = JKeyValue{} 1646 1647 // End of datatype JKeyValue 1648 1649 // Definition of datatype Jfrac 1650 type Jfrac struct { 1651 Data_Jfrac_ 1652 } 1653 1654 func (_this Jfrac) Get_() Data_Jfrac_ { 1655 return _this.Data_Jfrac_ 1656 } 1657 1658 type Data_Jfrac_ interface { 1659 isJfrac() 1660 } 1661 1662 type CompanionStruct_Jfrac_ struct { 1663 } 1664 1665 var Companion_Jfrac_ = CompanionStruct_Jfrac_{} 1666 1667 type Jfrac_JFrac struct { 1668 Period m_JSON_Utils_Views_Core.View__ 1669 Num m_JSON_Utils_Views_Core.View__ 1670 } 1671 1672 func (Jfrac_JFrac) isJfrac() {} 1673 1674 func (CompanionStruct_Jfrac_) Create_JFrac_(Period m_JSON_Utils_Views_Core.View__, Num m_JSON_Utils_Views_Core.View__) Jfrac { 1675 return Jfrac{Jfrac_JFrac{Period, Num}} 1676 } 1677 1678 func (_this Jfrac) Is_JFrac() bool { 1679 _, ok := _this.Get_().(Jfrac_JFrac) 1680 return ok 1681 } 1682 1683 func (CompanionStruct_Jfrac_) Default() Jfrac { 1684 return Companion_Jfrac_.Create_JFrac_(Companion_Jperiod_.Witness(), Companion_Jnum_.Witness()) 1685 } 1686 1687 func (_this Jfrac) Dtor_period() m_JSON_Utils_Views_Core.View__ { 1688 return _this.Get_().(Jfrac_JFrac).Period 1689 } 1690 1691 func (_this Jfrac) Dtor_num() m_JSON_Utils_Views_Core.View__ { 1692 return _this.Get_().(Jfrac_JFrac).Num 1693 } 1694 1695 func (_this Jfrac) String() string { 1696 switch data := _this.Get_().(type) { 1697 case nil: 1698 return "null" 1699 case Jfrac_JFrac: 1700 { 1701 return "Grammar.jfrac.JFrac" + "(" + _dafny.String(data.Period) + ", " + _dafny.String(data.Num) + ")" 1702 } 1703 default: 1704 { 1705 return "<unexpected>" 1706 } 1707 } 1708 } 1709 1710 func (_this Jfrac) Equals(other Jfrac) bool { 1711 switch data1 := _this.Get_().(type) { 1712 case Jfrac_JFrac: 1713 { 1714 data2, ok := other.Get_().(Jfrac_JFrac) 1715 return ok && data1.Period.Equals(data2.Period) && data1.Num.Equals(data2.Num) 1716 } 1717 default: 1718 { 1719 return false // unexpected 1720 } 1721 } 1722 } 1723 1724 func (_this Jfrac) EqualsGeneric(other interface{}) bool { 1725 typed, ok := other.(Jfrac) 1726 return ok && _this.Equals(typed) 1727 } 1728 1729 func Type_Jfrac_() _dafny.TypeDescriptor { 1730 return type_Jfrac_{} 1731 } 1732 1733 type type_Jfrac_ struct { 1734 } 1735 1736 func (_this type_Jfrac_) Default() interface{} { 1737 return Companion_Jfrac_.Default() 1738 } 1739 1740 func (_this type_Jfrac_) String() string { 1741 return "JSON_Grammar.Jfrac" 1742 } 1743 func (_this Jfrac) ParentTraits_() []*_dafny.TraitID { 1744 return [](*_dafny.TraitID){} 1745 } 1746 1747 var _ _dafny.TraitOffspring = Jfrac{} 1748 1749 // End of datatype Jfrac 1750 1751 // Definition of datatype Jexp 1752 type Jexp struct { 1753 Data_Jexp_ 1754 } 1755 1756 func (_this Jexp) Get_() Data_Jexp_ { 1757 return _this.Data_Jexp_ 1758 } 1759 1760 type Data_Jexp_ interface { 1761 isJexp() 1762 } 1763 1764 type CompanionStruct_Jexp_ struct { 1765 } 1766 1767 var Companion_Jexp_ = CompanionStruct_Jexp_{} 1768 1769 type Jexp_JExp struct { 1770 E m_JSON_Utils_Views_Core.View__ 1771 Sign m_JSON_Utils_Views_Core.View__ 1772 Num m_JSON_Utils_Views_Core.View__ 1773 } 1774 1775 func (Jexp_JExp) isJexp() {} 1776 1777 func (CompanionStruct_Jexp_) Create_JExp_(E m_JSON_Utils_Views_Core.View__, Sign m_JSON_Utils_Views_Core.View__, Num m_JSON_Utils_Views_Core.View__) Jexp { 1778 return Jexp{Jexp_JExp{E, Sign, Num}} 1779 } 1780 1781 func (_this Jexp) Is_JExp() bool { 1782 _, ok := _this.Get_().(Jexp_JExp) 1783 return ok 1784 } 1785 1786 func (CompanionStruct_Jexp_) Default() Jexp { 1787 return Companion_Jexp_.Create_JExp_(Companion_Je_.Witness(), Companion_Jsign_.Witness(), Companion_Jnum_.Witness()) 1788 } 1789 1790 func (_this Jexp) Dtor_e() m_JSON_Utils_Views_Core.View__ { 1791 return _this.Get_().(Jexp_JExp).E 1792 } 1793 1794 func (_this Jexp) Dtor_sign() m_JSON_Utils_Views_Core.View__ { 1795 return _this.Get_().(Jexp_JExp).Sign 1796 } 1797 1798 func (_this Jexp) Dtor_num() m_JSON_Utils_Views_Core.View__ { 1799 return _this.Get_().(Jexp_JExp).Num 1800 } 1801 1802 func (_this Jexp) String() string { 1803 switch data := _this.Get_().(type) { 1804 case nil: 1805 return "null" 1806 case Jexp_JExp: 1807 { 1808 return "Grammar.jexp.JExp" + "(" + _dafny.String(data.E) + ", " + _dafny.String(data.Sign) + ", " + _dafny.String(data.Num) + ")" 1809 } 1810 default: 1811 { 1812 return "<unexpected>" 1813 } 1814 } 1815 } 1816 1817 func (_this Jexp) Equals(other Jexp) bool { 1818 switch data1 := _this.Get_().(type) { 1819 case Jexp_JExp: 1820 { 1821 data2, ok := other.Get_().(Jexp_JExp) 1822 return ok && data1.E.Equals(data2.E) && data1.Sign.Equals(data2.Sign) && data1.Num.Equals(data2.Num) 1823 } 1824 default: 1825 { 1826 return false // unexpected 1827 } 1828 } 1829 } 1830 1831 func (_this Jexp) EqualsGeneric(other interface{}) bool { 1832 typed, ok := other.(Jexp) 1833 return ok && _this.Equals(typed) 1834 } 1835 1836 func Type_Jexp_() _dafny.TypeDescriptor { 1837 return type_Jexp_{} 1838 } 1839 1840 type type_Jexp_ struct { 1841 } 1842 1843 func (_this type_Jexp_) Default() interface{} { 1844 return Companion_Jexp_.Default() 1845 } 1846 1847 func (_this type_Jexp_) String() string { 1848 return "JSON_Grammar.Jexp" 1849 } 1850 func (_this Jexp) ParentTraits_() []*_dafny.TraitID { 1851 return [](*_dafny.TraitID){} 1852 } 1853 1854 var _ _dafny.TraitOffspring = Jexp{} 1855 1856 // End of datatype Jexp 1857 1858 // Definition of datatype Jnumber 1859 type Jnumber struct { 1860 Data_Jnumber_ 1861 } 1862 1863 func (_this Jnumber) Get_() Data_Jnumber_ { 1864 return _this.Data_Jnumber_ 1865 } 1866 1867 type Data_Jnumber_ interface { 1868 isJnumber() 1869 } 1870 1871 type CompanionStruct_Jnumber_ struct { 1872 } 1873 1874 var Companion_Jnumber_ = CompanionStruct_Jnumber_{} 1875 1876 type Jnumber_JNumber struct { 1877 Minus m_JSON_Utils_Views_Core.View__ 1878 Num m_JSON_Utils_Views_Core.View__ 1879 Frac Maybe 1880 Exp Maybe 1881 } 1882 1883 func (Jnumber_JNumber) isJnumber() {} 1884 1885 func (CompanionStruct_Jnumber_) Create_JNumber_(Minus m_JSON_Utils_Views_Core.View__, Num m_JSON_Utils_Views_Core.View__, Frac Maybe, Exp Maybe) Jnumber { 1886 return Jnumber{Jnumber_JNumber{Minus, Num, Frac, Exp}} 1887 } 1888 1889 func (_this Jnumber) Is_JNumber() bool { 1890 _, ok := _this.Get_().(Jnumber_JNumber) 1891 return ok 1892 } 1893 1894 func (CompanionStruct_Jnumber_) Default() Jnumber { 1895 return Companion_Jnumber_.Create_JNumber_(Companion_Jminus_.Witness(), Companion_Jnum_.Witness(), Companion_Maybe_.Default(), Companion_Maybe_.Default()) 1896 } 1897 1898 func (_this Jnumber) Dtor_minus() m_JSON_Utils_Views_Core.View__ { 1899 return _this.Get_().(Jnumber_JNumber).Minus 1900 } 1901 1902 func (_this Jnumber) Dtor_num() m_JSON_Utils_Views_Core.View__ { 1903 return _this.Get_().(Jnumber_JNumber).Num 1904 } 1905 1906 func (_this Jnumber) Dtor_frac() Maybe { 1907 return _this.Get_().(Jnumber_JNumber).Frac 1908 } 1909 1910 func (_this Jnumber) Dtor_exp() Maybe { 1911 return _this.Get_().(Jnumber_JNumber).Exp 1912 } 1913 1914 func (_this Jnumber) String() string { 1915 switch data := _this.Get_().(type) { 1916 case nil: 1917 return "null" 1918 case Jnumber_JNumber: 1919 { 1920 return "Grammar.jnumber.JNumber" + "(" + _dafny.String(data.Minus) + ", " + _dafny.String(data.Num) + ", " + _dafny.String(data.Frac) + ", " + _dafny.String(data.Exp) + ")" 1921 } 1922 default: 1923 { 1924 return "<unexpected>" 1925 } 1926 } 1927 } 1928 1929 func (_this Jnumber) Equals(other Jnumber) bool { 1930 switch data1 := _this.Get_().(type) { 1931 case Jnumber_JNumber: 1932 { 1933 data2, ok := other.Get_().(Jnumber_JNumber) 1934 return ok && data1.Minus.Equals(data2.Minus) && data1.Num.Equals(data2.Num) && data1.Frac.Equals(data2.Frac) && data1.Exp.Equals(data2.Exp) 1935 } 1936 default: 1937 { 1938 return false // unexpected 1939 } 1940 } 1941 } 1942 1943 func (_this Jnumber) EqualsGeneric(other interface{}) bool { 1944 typed, ok := other.(Jnumber) 1945 return ok && _this.Equals(typed) 1946 } 1947 1948 func Type_Jnumber_() _dafny.TypeDescriptor { 1949 return type_Jnumber_{} 1950 } 1951 1952 type type_Jnumber_ struct { 1953 } 1954 1955 func (_this type_Jnumber_) Default() interface{} { 1956 return Companion_Jnumber_.Default() 1957 } 1958 1959 func (_this type_Jnumber_) String() string { 1960 return "JSON_Grammar.Jnumber" 1961 } 1962 func (_this Jnumber) ParentTraits_() []*_dafny.TraitID { 1963 return [](*_dafny.TraitID){} 1964 } 1965 1966 var _ _dafny.TraitOffspring = Jnumber{} 1967 1968 // End of datatype Jnumber 1969 1970 // Definition of datatype Value 1971 type Value struct { 1972 Data_Value_ 1973 } 1974 1975 func (_this Value) Get_() Data_Value_ { 1976 return _this.Data_Value_ 1977 } 1978 1979 type Data_Value_ interface { 1980 isValue() 1981 } 1982 1983 type CompanionStruct_Value_ struct { 1984 } 1985 1986 var Companion_Value_ = CompanionStruct_Value_{} 1987 1988 type Value_Null struct { 1989 N m_JSON_Utils_Views_Core.View__ 1990 } 1991 1992 func (Value_Null) isValue() {} 1993 1994 func (CompanionStruct_Value_) Create_Null_(N m_JSON_Utils_Views_Core.View__) Value { 1995 return Value{Value_Null{N}} 1996 } 1997 1998 func (_this Value) Is_Null() bool { 1999 _, ok := _this.Get_().(Value_Null) 2000 return ok 2001 } 2002 2003 type Value_Bool struct { 2004 B m_JSON_Utils_Views_Core.View__ 2005 } 2006 2007 func (Value_Bool) isValue() {} 2008 2009 func (CompanionStruct_Value_) Create_Bool_(B m_JSON_Utils_Views_Core.View__) Value { 2010 return Value{Value_Bool{B}} 2011 } 2012 2013 func (_this Value) Is_Bool() bool { 2014 _, ok := _this.Get_().(Value_Bool) 2015 return ok 2016 } 2017 2018 type Value_String struct { 2019 Str Jstring 2020 } 2021 2022 func (Value_String) isValue() {} 2023 2024 func (CompanionStruct_Value_) Create_String_(Str Jstring) Value { 2025 return Value{Value_String{Str}} 2026 } 2027 2028 func (_this Value) Is_String() bool { 2029 _, ok := _this.Get_().(Value_String) 2030 return ok 2031 } 2032 2033 type Value_Number struct { 2034 Num Jnumber 2035 } 2036 2037 func (Value_Number) isValue() {} 2038 2039 func (CompanionStruct_Value_) Create_Number_(Num Jnumber) Value { 2040 return Value{Value_Number{Num}} 2041 } 2042 2043 func (_this Value) Is_Number() bool { 2044 _, ok := _this.Get_().(Value_Number) 2045 return ok 2046 } 2047 2048 type Value_Object struct { 2049 Obj Bracketed 2050 } 2051 2052 func (Value_Object) isValue() {} 2053 2054 func (CompanionStruct_Value_) Create_Object_(Obj Bracketed) Value { 2055 return Value{Value_Object{Obj}} 2056 } 2057 2058 func (_this Value) Is_Object() bool { 2059 _, ok := _this.Get_().(Value_Object) 2060 return ok 2061 } 2062 2063 type Value_Array struct { 2064 Arr Bracketed 2065 } 2066 2067 func (Value_Array) isValue() {} 2068 2069 func (CompanionStruct_Value_) Create_Array_(Arr Bracketed) Value { 2070 return Value{Value_Array{Arr}} 2071 } 2072 2073 func (_this Value) Is_Array() bool { 2074 _, ok := _this.Get_().(Value_Array) 2075 return ok 2076 } 2077 2078 func (CompanionStruct_Value_) Default() Value { 2079 return Companion_Value_.Create_Null_(Companion_Jnull_.Witness()) 2080 } 2081 2082 func (_this Value) Dtor_n() m_JSON_Utils_Views_Core.View__ { 2083 return _this.Get_().(Value_Null).N 2084 } 2085 2086 func (_this Value) Dtor_b() m_JSON_Utils_Views_Core.View__ { 2087 return _this.Get_().(Value_Bool).B 2088 } 2089 2090 func (_this Value) Dtor_str() Jstring { 2091 return _this.Get_().(Value_String).Str 2092 } 2093 2094 func (_this Value) Dtor_num() Jnumber { 2095 return _this.Get_().(Value_Number).Num 2096 } 2097 2098 func (_this Value) Dtor_obj() Bracketed { 2099 return _this.Get_().(Value_Object).Obj 2100 } 2101 2102 func (_this Value) Dtor_arr() Bracketed { 2103 return _this.Get_().(Value_Array).Arr 2104 } 2105 2106 func (_this Value) String() string { 2107 switch data := _this.Get_().(type) { 2108 case nil: 2109 return "null" 2110 case Value_Null: 2111 { 2112 return "Grammar.Value.Null" + "(" + _dafny.String(data.N) + ")" 2113 } 2114 case Value_Bool: 2115 { 2116 return "Grammar.Value.Bool" + "(" + _dafny.String(data.B) + ")" 2117 } 2118 case Value_String: 2119 { 2120 return "Grammar.Value.String" + "(" + _dafny.String(data.Str) + ")" 2121 } 2122 case Value_Number: 2123 { 2124 return "Grammar.Value.Number" + "(" + _dafny.String(data.Num) + ")" 2125 } 2126 case Value_Object: 2127 { 2128 return "Grammar.Value.Object" + "(" + _dafny.String(data.Obj) + ")" 2129 } 2130 case Value_Array: 2131 { 2132 return "Grammar.Value.Array" + "(" + _dafny.String(data.Arr) + ")" 2133 } 2134 default: 2135 { 2136 return "<unexpected>" 2137 } 2138 } 2139 } 2140 2141 func (_this Value) Equals(other Value) bool { 2142 switch data1 := _this.Get_().(type) { 2143 case Value_Null: 2144 { 2145 data2, ok := other.Get_().(Value_Null) 2146 return ok && data1.N.Equals(data2.N) 2147 } 2148 case Value_Bool: 2149 { 2150 data2, ok := other.Get_().(Value_Bool) 2151 return ok && data1.B.Equals(data2.B) 2152 } 2153 case Value_String: 2154 { 2155 data2, ok := other.Get_().(Value_String) 2156 return ok && data1.Str.Equals(data2.Str) 2157 } 2158 case Value_Number: 2159 { 2160 data2, ok := other.Get_().(Value_Number) 2161 return ok && data1.Num.Equals(data2.Num) 2162 } 2163 case Value_Object: 2164 { 2165 data2, ok := other.Get_().(Value_Object) 2166 return ok && data1.Obj.Equals(data2.Obj) 2167 } 2168 case Value_Array: 2169 { 2170 data2, ok := other.Get_().(Value_Array) 2171 return ok && data1.Arr.Equals(data2.Arr) 2172 } 2173 default: 2174 { 2175 return false // unexpected 2176 } 2177 } 2178 } 2179 2180 func (_this Value) EqualsGeneric(other interface{}) bool { 2181 typed, ok := other.(Value) 2182 return ok && _this.Equals(typed) 2183 } 2184 2185 func Type_Value_() _dafny.TypeDescriptor { 2186 return type_Value_{} 2187 } 2188 2189 type type_Value_ struct { 2190 } 2191 2192 func (_this type_Value_) Default() interface{} { 2193 return Companion_Value_.Default() 2194 } 2195 2196 func (_this type_Value_) String() string { 2197 return "JSON_Grammar.Value" 2198 } 2199 func (_this Value) ParentTraits_() []*_dafny.TraitID { 2200 return [](*_dafny.TraitID){} 2201 } 2202 2203 var _ _dafny.TraitOffspring = Value{} 2204 2205 // End of datatype Value