github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library@v0.2.0/JSON_Utils_Parsers/JSON_Utils_Parsers.go (about) 1 // Package JSON_Utils_Parsers 2 // Dafny module JSON_Utils_Parsers compiled into Go 3 4 package JSON_Utils_Parsers 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_Utils_Cursors "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/JSON_Utils_Cursors" 23 m_JSON_Utils_Lexers_Core "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/JSON_Utils_Lexers_Core" 24 m_JSON_Utils_Lexers_Strings "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/JSON_Utils_Lexers_Strings" 25 m_JSON_Utils_Views_Core "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/JSON_Utils_Views_Core" 26 m_JSON_Utils_Views_Writers "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/JSON_Utils_Views_Writers" 27 m_Logarithm "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Logarithm" 28 m__Math "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Math_" 29 m_ModInternals "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/ModInternals" 30 m_ModInternalsNonlinear "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/ModInternalsNonlinear" 31 m_Mul "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Mul" 32 m_MulInternals "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/MulInternals" 33 m_MulInternalsNonlinear "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/MulInternalsNonlinear" 34 m_Power "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Power" 35 m_Relations "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Relations" 36 m_Seq "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Seq" 37 m_Seq_MergeSort "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Seq_MergeSort" 38 m_Sorting "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Sorting" 39 m_StandardLibrary "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/StandardLibrary" 40 m_StandardLibraryInterop "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/StandardLibraryInterop" 41 m_StandardLibrary_Sequence "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/StandardLibrary_Sequence" 42 m_StandardLibrary_String "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/StandardLibrary_String" 43 m_StandardLibrary_UInt "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/StandardLibrary_UInt" 44 m_Streams "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Streams" 45 m_UnicodeStrings "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/UnicodeStrings" 46 m__Unicode "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Unicode_" 47 m_Utf16EncodingForm "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Utf16EncodingForm" 48 m_Utf8EncodingForm "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Utf8EncodingForm" 49 m_Wrappers "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Wrappers" 50 m__System "github.com/dafny-lang/DafnyRuntimeGo/v4/System_" 51 _dafny "github.com/dafny-lang/DafnyRuntimeGo/v4/dafny" 52 ) 53 54 var _ = os.Args 55 var _ _dafny.Dummy__ 56 var _ m__System.Dummy__ 57 var _ m_Wrappers.Dummy__ 58 var _ m_Relations.Dummy__ 59 var _ m_Seq_MergeSort.Dummy__ 60 var _ m__Math.Dummy__ 61 var _ m_Seq.Dummy__ 62 var _ m_BoundedInts.Dummy__ 63 var _ m__Unicode.Dummy__ 64 var _ m_Functions.Dummy__ 65 var _ m_Utf8EncodingForm.Dummy__ 66 var _ m_Utf16EncodingForm.Dummy__ 67 var _ m_UnicodeStrings.Dummy__ 68 var _ m_FileIO.Dummy__ 69 var _ m_GeneralInternals.Dummy__ 70 var _ m_MulInternalsNonlinear.Dummy__ 71 var _ m_MulInternals.Dummy__ 72 var _ m_Mul.Dummy__ 73 var _ m_ModInternalsNonlinear.Dummy__ 74 var _ m_DivInternalsNonlinear.Dummy__ 75 var _ m_ModInternals.Dummy__ 76 var _ m_DivInternals.Dummy__ 77 var _ m_DivMod.Dummy__ 78 var _ m_Power.Dummy__ 79 var _ m_Logarithm.Dummy__ 80 var _ m_StandardLibraryInterop.Dummy__ 81 var _ m_StandardLibrary_UInt.Dummy__ 82 var _ m_StandardLibrary_Sequence.Dummy__ 83 var _ m_StandardLibrary_String.Dummy__ 84 var _ m_StandardLibrary.Dummy__ 85 var _ m_Streams.Dummy__ 86 var _ m_Sorting.Dummy__ 87 var _ m_HexStrings.Dummy__ 88 var _ m_GetOpt.Dummy__ 89 var _ m_FloatCompare.Dummy__ 90 var _ m_Base64.Dummy__ 91 var _ m_Base64Lemmas.Dummy__ 92 var _ m_Actions.Dummy__ 93 var _ m_JSON_Utils_Views_Core.Dummy__ 94 var _ m_JSON_Utils_Views_Writers.Dummy__ 95 var _ m_JSON_Utils_Lexers_Core.Dummy__ 96 var _ m_JSON_Utils_Lexers_Strings.Dummy__ 97 var _ m_JSON_Utils_Cursors.Dummy__ 98 99 type Dummy__ struct{} 100 101 // Definition of class Default__ 102 type Default__ struct { 103 dummy byte 104 } 105 106 func New_Default___() *Default__ { 107 _this := Default__{} 108 109 return &_this 110 } 111 112 type CompanionStruct_Default___ struct { 113 } 114 115 var Companion_Default___ = CompanionStruct_Default___{} 116 117 func (_this *Default__) Equals(other *Default__) bool { 118 return _this == other 119 } 120 121 func (_this *Default__) EqualsGeneric(x interface{}) bool { 122 other, ok := x.(*Default__) 123 return ok && _this.Equals(other) 124 } 125 126 func (*Default__) String() string { 127 return "JSON_Utils_Parsers.Default__" 128 } 129 func (_this *Default__) ParentTraits_() []*_dafny.TraitID { 130 return [](*_dafny.TraitID){} 131 } 132 133 var _ _dafny.TraitOffspring = &Default__{} 134 135 func (_static *CompanionStruct_Default___) ParserWitness() Parser__ { 136 return Companion_Parser___.Create_Parser_(func(coer33 func(m_JSON_Utils_Cursors.Cursor__) m_Wrappers.Result) func(m_JSON_Utils_Cursors.Cursor__) m_Wrappers.Result { 137 return func(arg37 m_JSON_Utils_Cursors.Cursor__) m_Wrappers.Result { 138 return coer33(arg37) 139 } 140 }(func(_0___v0 m_JSON_Utils_Cursors.Cursor__) m_Wrappers.Result { 141 return m_Wrappers.Companion_Result_.Create_Failure_(m_JSON_Utils_Cursors.Companion_CursorError_.Create_EOF_()) 142 })) 143 } 144 func (_static *CompanionStruct_Default___) SubParserWitness() SubParser__ { 145 return Companion_SubParser___.Create_SubParser_(func(coer34 func(m_JSON_Utils_Cursors.Cursor__) m_Wrappers.Result) func(m_JSON_Utils_Cursors.Cursor__) m_Wrappers.Result { 146 return func(arg38 m_JSON_Utils_Cursors.Cursor__) m_Wrappers.Result { 147 return coer34(arg38) 148 } 149 }(func(_0_cs m_JSON_Utils_Cursors.Cursor__) m_Wrappers.Result { 150 return m_Wrappers.Companion_Result_.Create_Failure_(m_JSON_Utils_Cursors.Companion_CursorError_.Create_EOF_()) 151 })) 152 } 153 154 // End of class Default__ 155 156 // Definition of class Parser 157 type Parser struct { 158 } 159 160 func New_Parser_() *Parser { 161 _this := Parser{} 162 163 return &_this 164 } 165 166 type CompanionStruct_Parser_ struct { 167 } 168 169 var Companion_Parser_ = CompanionStruct_Parser_{} 170 171 func (*Parser) String() string { 172 return "JSON_Utils_Parsers.Parser" 173 } 174 func (_this *CompanionStruct_Parser_) Witness() Parser__ { 175 return Companion_Default___.ParserWitness() 176 } 177 178 // End of class Parser 179 180 func Type_Parser_(Type_T_ _dafny.TypeDescriptor, Type_R_ _dafny.TypeDescriptor) _dafny.TypeDescriptor { 181 return type_Parser_{Type_T_, Type_R_} 182 } 183 184 type type_Parser_ struct { 185 Type_T_ _dafny.TypeDescriptor 186 Type_R_ _dafny.TypeDescriptor 187 } 188 189 func (_this type_Parser_) Default() interface{} { 190 Type_T_ := _this.Type_T_ 191 _ = Type_T_ 192 Type_R_ := _this.Type_R_ 193 _ = Type_R_ 194 return Companion_Parser_.Witness() 195 } 196 197 func (_this type_Parser_) String() string { 198 return "JSON_Utils_Parsers.Parser" 199 } 200 201 // Definition of datatype Parser__ 202 type Parser__ struct { 203 Data_Parser___ 204 } 205 206 func (_this Parser__) Get_() Data_Parser___ { 207 return _this.Data_Parser___ 208 } 209 210 type Data_Parser___ interface { 211 isParser__() 212 } 213 214 type CompanionStruct_Parser___ struct { 215 } 216 217 var Companion_Parser___ = CompanionStruct_Parser___{} 218 219 type Parser___Parser struct { 220 Fn func(m_JSON_Utils_Cursors.Cursor__) m_Wrappers.Result 221 } 222 223 func (Parser___Parser) isParser__() {} 224 225 func (CompanionStruct_Parser___) Create_Parser_(Fn func(m_JSON_Utils_Cursors.Cursor__) m_Wrappers.Result) Parser__ { 226 return Parser__{Parser___Parser{Fn}} 227 } 228 229 func (_this Parser__) Is_Parser() bool { 230 _, ok := _this.Get_().(Parser___Parser) 231 return ok 232 } 233 234 func (CompanionStruct_Parser___) Default(_default_T interface{}) Parser__ { 235 return Companion_Parser___.Create_Parser_(func(m_JSON_Utils_Cursors.Cursor__) m_Wrappers.Result { 236 return m_Wrappers.Companion_Result_.Default(m_JSON_Utils_Cursors.Companion_Split_.Default(_default_T)) 237 }) 238 } 239 240 func (_this Parser__) Dtor_fn() func(m_JSON_Utils_Cursors.Cursor__) m_Wrappers.Result { 241 return _this.Get_().(Parser___Parser).Fn 242 } 243 244 func (_this Parser__) String() string { 245 switch data := _this.Get_().(type) { 246 case nil: 247 return "null" 248 case Parser___Parser: 249 { 250 return "Parsers.Parser_.Parser" + "(" + _dafny.String(data.Fn) + ")" 251 } 252 default: 253 { 254 return "<unexpected>" 255 } 256 } 257 } 258 259 func (_this Parser__) Equals(other Parser__) bool { 260 switch data1 := _this.Get_().(type) { 261 case Parser___Parser: 262 { 263 data2, ok := other.Get_().(Parser___Parser) 264 return ok && _dafny.AreEqual(data1.Fn, data2.Fn) 265 } 266 default: 267 { 268 return false // unexpected 269 } 270 } 271 } 272 273 func (_this Parser__) EqualsGeneric(other interface{}) bool { 274 typed, ok := other.(Parser__) 275 return ok && _this.Equals(typed) 276 } 277 278 func Type_Parser___(Type_T_ _dafny.TypeDescriptor) _dafny.TypeDescriptor { 279 return type_Parser___{Type_T_} 280 } 281 282 type type_Parser___ struct { 283 Type_T_ _dafny.TypeDescriptor 284 } 285 286 func (_this type_Parser___) Default() interface{} { 287 Type_T_ := _this.Type_T_ 288 _ = Type_T_ 289 return Companion_Parser___.Default(Type_T_.Default()) 290 } 291 292 func (_this type_Parser___) String() string { 293 return "JSON_Utils_Parsers.Parser__" 294 } 295 func (_this Parser__) ParentTraits_() []*_dafny.TraitID { 296 return [](*_dafny.TraitID){} 297 } 298 299 var _ _dafny.TraitOffspring = Parser__{} 300 301 // End of datatype Parser__ 302 303 // Definition of datatype SubParser__ 304 type SubParser__ struct { 305 Data_SubParser___ 306 } 307 308 func (_this SubParser__) Get_() Data_SubParser___ { 309 return _this.Data_SubParser___ 310 } 311 312 type Data_SubParser___ interface { 313 isSubParser__() 314 } 315 316 type CompanionStruct_SubParser___ struct { 317 } 318 319 var Companion_SubParser___ = CompanionStruct_SubParser___{} 320 321 type SubParser___SubParser struct { 322 Fn func(m_JSON_Utils_Cursors.Cursor__) m_Wrappers.Result 323 } 324 325 func (SubParser___SubParser) isSubParser__() {} 326 327 func (CompanionStruct_SubParser___) Create_SubParser_(Fn func(m_JSON_Utils_Cursors.Cursor__) m_Wrappers.Result) SubParser__ { 328 return SubParser__{SubParser___SubParser{Fn}} 329 } 330 331 func (_this SubParser__) Is_SubParser() bool { 332 _, ok := _this.Get_().(SubParser___SubParser) 333 return ok 334 } 335 336 func (CompanionStruct_SubParser___) Default() SubParser__ { 337 return Companion_SubParser___.Create_SubParser_((func(m_JSON_Utils_Cursors.Cursor__) m_Wrappers.Result)(nil)) 338 } 339 340 func (_this SubParser__) Dtor_fn() func(m_JSON_Utils_Cursors.Cursor__) m_Wrappers.Result { 341 return _this.Get_().(SubParser___SubParser).Fn 342 } 343 344 func (_this SubParser__) String() string { 345 switch data := _this.Get_().(type) { 346 case nil: 347 return "null" 348 case SubParser___SubParser: 349 { 350 return "Parsers.SubParser_.SubParser" + "(" + _dafny.String(data.Fn) + ")" 351 } 352 default: 353 { 354 return "<unexpected>" 355 } 356 } 357 } 358 359 func (_this SubParser__) Equals(other SubParser__) bool { 360 switch data1 := _this.Get_().(type) { 361 case SubParser___SubParser: 362 { 363 data2, ok := other.Get_().(SubParser___SubParser) 364 return ok && _dafny.AreEqual(data1.Fn, data2.Fn) 365 } 366 default: 367 { 368 return false // unexpected 369 } 370 } 371 } 372 373 func (_this SubParser__) EqualsGeneric(other interface{}) bool { 374 typed, ok := other.(SubParser__) 375 return ok && _this.Equals(typed) 376 } 377 378 func Type_SubParser___() _dafny.TypeDescriptor { 379 return type_SubParser___{} 380 } 381 382 type type_SubParser___ struct { 383 } 384 385 func (_this type_SubParser___) Default() interface{} { 386 return Companion_SubParser___.Default() 387 } 388 389 func (_this type_SubParser___) String() string { 390 return "JSON_Utils_Parsers.SubParser__" 391 } 392 func (_this SubParser__) ParentTraits_() []*_dafny.TraitID { 393 return [](*_dafny.TraitID){} 394 } 395 396 var _ _dafny.TraitOffspring = SubParser__{} 397 398 // End of datatype SubParser__ 399 400 // Definition of class SubParser 401 type SubParser struct { 402 } 403 404 func New_SubParser_() *SubParser { 405 _this := SubParser{} 406 407 return &_this 408 } 409 410 type CompanionStruct_SubParser_ struct { 411 } 412 413 var Companion_SubParser_ = CompanionStruct_SubParser_{} 414 415 func (*SubParser) String() string { 416 return "JSON_Utils_Parsers.SubParser" 417 } 418 func (_this *CompanionStruct_SubParser_) Witness() SubParser__ { 419 return Companion_Default___.SubParserWitness() 420 } 421 422 // End of class SubParser 423 424 func Type_SubParser_(Type_T_ _dafny.TypeDescriptor, Type_R_ _dafny.TypeDescriptor) _dafny.TypeDescriptor { 425 return type_SubParser_{Type_T_, Type_R_} 426 } 427 428 type type_SubParser_ struct { 429 Type_T_ _dafny.TypeDescriptor 430 Type_R_ _dafny.TypeDescriptor 431 } 432 433 func (_this type_SubParser_) Default() interface{} { 434 Type_T_ := _this.Type_T_ 435 _ = Type_T_ 436 Type_R_ := _this.Type_R_ 437 _ = Type_R_ 438 return Companion_SubParser_.Witness() 439 } 440 441 func (_this type_SubParser_) String() string { 442 return "JSON_Utils_Parsers.SubParser" 443 }