Debian Codegraph @

parser/input.go

raw symbols SCIP
1 // Copyright 2021 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 package parserscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/
16
17 import (
18 antlrscip-go gomod github.com/antlr4-go/antlr/v4 v4.13.1 `github.com/antlr4-go/antlr/v4`/ "github.com/antlr4-go/antlr/v4scip-go gomod github.com/antlr4-go/antlr/v4 v4.13.1 `github.com/antlr4-go/antlr/v4`/"
19
20 "github.com/google/cel-go/common/runesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/runes`/"
21 )
22
23 type charStreamscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream# struct {
24 bufscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#buf. runesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/runes`/.Bufferscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/runes`/Buffer#
25 posscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#pos. int
26 srcscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#src. string
27 }
28
29 // Consume implements (antlr.CharStream).Consume.
30 func (c *charStreamscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#) Consumescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#Consume().() {
31 if c.posscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#pos. >= c.bufscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#buf..Lenscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/runes`/Buffer#Len.() {
32 panic("cannot consume EOF")
33 }
34 c.posscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#pos.++
35 }
36
37 // LA implements (antlr.CharStream).LA.
38 func (c *charStreamscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#) LAscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#LA().(offset int) int {
39 if offset == 0 {
40 return 0
41 }
42 if offset < 0 {
43 offset++
44 }
45 pos := c.posscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#pos. + offset - 1
46 if pos < 0 || pos >= c.bufscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#buf..Lenscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/runes`/Buffer#Len.() {
47 return antlrscip-go gomod github.com/antlr4-go/antlr/v4 v4.13.1 `github.com/antlr4-go/antlr/v4`/.TokenEOFscip-go gomod github.com/antlr4-go/antlr/v4 v4.13.1 `github.com/antlr4-go/antlr/v4`/TokenEOF.
48 }
49 return int(c.bufscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#buf..Getscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/runes`/Buffer#Get.(pos))
50 }
51
52 // LT mimics (*antlr.InputStream).LT.
53 func (c *charStreamscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#) LTscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#LT().(offset int) int {
54 return c.LAscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#LA().(offset)
55 }
56
57 // Mark implements (antlr.CharStream).Mark.
58 func (c *charStreamscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#) Markscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#Mark().() int {
59 return -1
60 }
61
62 // Release implements (antlr.CharStream).Release.
63 func (c *charStreamscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#) Releasescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#Release().(marker int) {}
64
65 // Index implements (antlr.CharStream).Index.
66 func (c *charStreamscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#) Indexscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#Index().() int {
67 return c.posscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#pos.
68 }
69
70 // Seek implements (antlr.CharStream).Seek.
71 func (c *charStreamscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#) Seekscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#Seek().(index int) {
72 if index <= c.posscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#pos. {
73 c.posscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#pos. = index
74 return
75 }
76 if index < c.bufscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#buf..Lenscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/runes`/Buffer#Len.() {
77 c.posscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#pos. = index
78 } else {
79 c.posscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#pos. = c.bufscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#buf..Lenscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/runes`/Buffer#Len.()
80 }
81 }
82
83 // Size implements (antlr.CharStream).Size.
84 func (c *charStreamscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#) Sizescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#Size().() int {
85 return c.bufscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#buf..Lenscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/runes`/Buffer#Len.()
86 }
87
88 // GetSourceName implements (antlr.CharStream).GetSourceName.
89 func (c *charStreamscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#) GetSourceNamescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#GetSourceName().() string {
90 return c.srcscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#src.
91 }
92
93 // GetText implements (antlr.CharStream).GetText.
94 func (c *charStreamscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#) GetTextscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#GetText().(start, stop int) string {
95 if stop >= c.bufscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#buf..Lenscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/runes`/Buffer#Len.() {
96 stop = c.bufscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#buf..Lenscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/runes`/Buffer#Len.() - 1
97 }
98 if start >= c.bufscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#buf..Lenscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/runes`/Buffer#Len.() {
99 return ""
100 }
101 return c.bufscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#buf..Slicescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/runes`/Buffer#Slice.(start, stop+1)
102 }
103
104 // GetTextFromTokens implements (antlr.CharStream).GetTextFromTokens.
105 func (c *charStreamscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#) GetTextFromTokensscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#GetTextFromTokens().(start, stop antlrscip-go gomod github.com/antlr4-go/antlr/v4 v4.13.1 `github.com/antlr4-go/antlr/v4`/.Tokenscip-go gomod github.com/antlr4-go/antlr/v4 v4.13.1 `github.com/antlr4-go/antlr/v4`/Token#) string {
106 if start != nil && stop != nil {
107 return c.GetTextscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#GetText().(start.GetTokenIndexscip-go gomod github.com/antlr4-go/antlr/v4 v4.13.1 `github.com/antlr4-go/antlr/v4`/Token#GetTokenIndex().(), stop.GetTokenIndexscip-go gomod github.com/antlr4-go/antlr/v4 v4.13.1 `github.com/antlr4-go/antlr/v4`/Token#GetTokenIndex().())
108 }
109 return ""
110 }
111
112 // GetTextFromInterval implements (antlr.CharStream).GetTextFromInterval.
113 func (c *charStreamscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#) GetTextFromIntervalscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#GetTextFromInterval().(i antlrscip-go gomod github.com/antlr4-go/antlr/v4 v4.13.1 `github.com/antlr4-go/antlr/v4`/.Intervalscip-go gomod github.com/antlr4-go/antlr/v4 v4.13.1 `github.com/antlr4-go/antlr/v4`/Interval#) string {
114 return c.GetTextscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#GetText().(i.Startscip-go gomod github.com/antlr4-go/antlr/v4 v4.13.1 `github.com/antlr4-go/antlr/v4`/Interval#Start., i.Stopscip-go gomod github.com/antlr4-go/antlr/v4 v4.13.1 `github.com/antlr4-go/antlr/v4`/Interval#Stop.)
115 }
116
117 // String mimics (*antlr.InputStream).String.
118 func (c *charStreamscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#) Stringscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#String().() string {
119 return c.bufscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#buf..Slicescip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/runes`/Buffer#Slice.(0, c.bufscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#buf..Lenscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/runes`/Buffer#Len.())
120 }
121
122 var _ antlrscip-go gomod github.com/antlr4-go/antlr/v4 v4.13.1 `github.com/antlr4-go/antlr/v4`/.CharStreamscip-go gomod github.com/antlr4-go/antlr/v4 v4.13.1 `github.com/antlr4-go/antlr/v4`/CharStream# = &charStreamscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#{}
123
124 func newCharStreamscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/newCharStream().(buf runesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/runes`/.Bufferscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/common/runes`/Buffer#, desc string) antlrscip-go gomod github.com/antlr4-go/antlr/v4 v4.13.1 `github.com/antlr4-go/antlr/v4`/.CharStreamscip-go gomod github.com/antlr4-go/antlr/v4 v4.13.1 `github.com/antlr4-go/antlr/v4`/CharStream# {
125 return &charStreamscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#{
126 bufscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#buf.: buf,
127 srcscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/parser`/charStream#src.: desc,
128 }
129 }