MCPcopy Create free account
hub / github.com/crossoverJie/gscript / ClassDeclaration

Method ClassDeclaration

parser/gscript_parser.go:543–609  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

541}
542
543func (p *GScriptParser) ClassDeclaration() (localctx IClassDeclarationContext) {
544 localctx = NewClassDeclarationContext(p, p.GetParserRuleContext(), p.GetState())
545 p.EnterRule(localctx, 0, GScriptParserRULE_classDeclaration)
546 var _la int
547
548 defer func() {
549 p.ExitRule()
550 }()
551
552 defer func() {
553 if err := recover(); err != nil {
554 if v, ok := err.(antlr.RecognitionException); ok {
555 localctx.SetException(v)
556 p.GetErrorHandler().ReportError(p, v)
557 p.GetErrorHandler().Recover(p, v)
558 } else {
559 panic(err)
560 }
561 }
562 }()
563
564 p.EnterOuterAlt(localctx, 1)
565 {
566 p.SetState(86)
567 p.Match(GScriptParserCLASS)
568 }
569 {
570 p.SetState(87)
571 p.Match(GScriptParserIDENTIFIER)
572 }
573 p.SetState(90)
574 p.GetErrorHandler().Sync(p)
575 _la = p.GetTokenStream().LA(1)
576
577 if _la == GScriptParserEXTENDS {
578 {
579 p.SetState(88)
580 p.Match(GScriptParserEXTENDS)
581 }
582 {
583 p.SetState(89)
584 p.TypeType()
585 }
586
587 }
588 p.SetState(94)
589 p.GetErrorHandler().Sync(p)
590 _la = p.GetTokenStream().LA(1)
591
592 if _la == GScriptParserIMPLEMENTS {
593 {
594 p.SetState(92)
595 p.Match(GScriptParserIMPLEMENTS)
596 }
597 {
598 p.SetState(93)
599 p.TypeList()
600 }

Callers 1

BlockStatementMethod · 0.95

Calls 6

TypeTypeMethod · 0.95
TypeListMethod · 0.95
ClassBodyMethod · 0.95
EnterRuleMethod · 0.45
ExitRuleMethod · 0.45

Tested by

no test coverage detected