MCPcopy Index your code
hub / github.com/google/mangle / PackageDecl

Method PackageDecl

parse/gen/mangle_parser.go:874–930  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

872}
873
874func (p *MangleParser) PackageDecl() (localctx IPackageDeclContext) {
875 localctx = NewPackageDeclContext(p, p.GetParserRuleContext(), p.GetState())
876 p.EnterRule(localctx, 4, MangleParserRULE_packageDecl)
877 var _la int
878
879 p.EnterOuterAlt(localctx, 1)
880 {
881 p.SetState(59)
882 p.Match(MangleParserPACKAGE)
883 if p.HasError() {
884 // Recognition error - abort rule
885 goto errorExit
886 }
887 }
888 {
889 p.SetState(60)
890 p.Match(MangleParserNAME)
891 if p.HasError() {
892 // Recognition error - abort rule
893 goto errorExit
894 }
895 }
896 p.SetState(62)
897 p.GetErrorHandler().Sync(p)
898 if p.HasError() {
899 goto errorExit
900 }
901 _la = p.GetTokenStream().LA(1)
902
903 if _la == MangleParserLBRACKET {
904 {
905 p.SetState(61)
906 p.Atoms()
907 }
908
909 }
910 {
911 p.SetState(64)
912 p.Match(MangleParserBANG)
913 if p.HasError() {
914 // Recognition error - abort rule
915 goto errorExit
916 }
917 }
918
919errorExit:
920 if p.HasError() {
921 v := p.GetError()
922 localctx.SetException(v)
923 p.GetErrorHandler().ReportError(p, v)
924 p.GetErrorHandler().Recover(p, v)
925 p.SetError(nil)
926 }
927 p.ExitRule()
928 return localctx
929 goto errorExit // Trick to prevent compiler error if the label is not used
930}
931

Callers 1

ProgramMethod · 0.95

Calls 4

AtomsMethod · 0.95
NewPackageDeclContextFunction · 0.85
EnterRuleMethod · 0.45
ExitRuleMethod · 0.45

Tested by

no test coverage detected