()
| 195 | } |
| 196 | |
| 197 | func (p *Parser) parse() { |
| 198 | for p.pos < len(p.tokens) { |
| 199 | token := p.peek() |
| 200 | |
| 201 | if token.Value == "package" { |
| 202 | p.parsePackage() |
| 203 | } else if token.Value == "import" { |
| 204 | p.parseImport() |
| 205 | } else if token.Value == "public" || token.Value == "class" || token.Value == "interface" || token.Value == "@" { |
| 206 | // Start of class definition (potentially with annotations) |
| 207 | p.parseClass() |
| 208 | } else { |
| 209 | p.next() |
| 210 | } |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | func (p *Parser) parsePackage() { |
| 215 | p.consume("package") |
no test coverage detected