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

Method ClassBody

parser/gscript_parser.go:710–756  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

708}
709
710func (p *GScriptParser) ClassBody() (localctx IClassBodyContext) {
711 localctx = NewClassBodyContext(p, p.GetParserRuleContext(), p.GetState())
712 p.EnterRule(localctx, 2, GScriptParserRULE_classBody)
713 var _la int
714
715 defer func() {
716 p.ExitRule()
717 }()
718
719 defer func() {
720 if err := recover(); err != nil {
721 if v, ok := err.(antlr.RecognitionException); ok {
722 localctx.SetException(v)
723 p.GetErrorHandler().ReportError(p, v)
724 p.GetErrorHandler().Recover(p, v)
725 } else {
726 panic(err)
727 }
728 }
729 }()
730
731 p.EnterOuterAlt(localctx, 1)
732 {
733 p.SetState(98)
734 p.Match(GScriptParserLBRACE)
735 }
736 p.SetState(102)
737 p.GetErrorHandler().Sync(p)
738 _la = p.GetTokenStream().LA(1)
739
740 for (((_la)&-(0x1f+1)) == 0 && ((1<<uint(_la))&((1<<GScriptParserT__0)|(1<<GScriptParserINT)|(1<<GScriptParserSTRING)|(1<<GScriptParserFLOAT)|(1<<GScriptParserBOOLEAN)|(1<<GScriptParserBYTE)|(1<<GScriptParserANY))) != 0) || (((_la-48)&-(0x1f+1)) == 0 && ((1<<uint((_la-48)))&((1<<(GScriptParserFUNCTION-48))|(1<<(GScriptParserVOID-48))|(1<<(GScriptParserIDENTIFIER-48)))) != 0) {
741 {
742 p.SetState(99)
743 p.ClassBodyDeclaration()
744 }
745
746 p.SetState(104)
747 p.GetErrorHandler().Sync(p)
748 _la = p.GetTokenStream().LA(1)
749 }
750 {
751 p.SetState(105)
752 p.Match(GScriptParserRBRACE)
753 }
754
755 return localctx
756}
757
758// IClassBodyDeclarationContext is an interface to support dynamic dispatch.
759type IClassBodyDeclarationContext interface {

Callers 2

ClassDeclarationMethod · 0.95
VisitClassDeclarationMethod · 0.45

Calls 4

ClassBodyDeclarationMethod · 0.95
NewClassBodyContextFunction · 0.85
EnterRuleMethod · 0.45
ExitRuleMethod · 0.45

Tested by

no test coverage detected