Skip to content

Commit

Permalink
Removed logger statements in ColIPPParser
Browse files Browse the repository at this point in the history
  • Loading branch information
Ellen Wittingen committed Dec 12, 2023
1 parent 07f5494 commit 1e86872
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/parsers/vct/parsers/ColIPPParser.scala
Original file line number Diff line number Diff line change
@@ -1,34 +1,25 @@
package vct.parsers

import com.typesafe.scalalogging.LazyLogging
import org.antlr.v4.runtime.{CharStream, CommonTokenStream}
import vct.antlr4.generated.{CPPParser, LangCPPLexer}
import vct.col.origin.Origin
import vct.parsers.transform.{BlameProvider, CPPToCol}

case class ColIPPParser(override val origin: Origin, override val blameProvider: BlameProvider, val cppOrigin: Option[Origin]) extends Parser(origin, blameProvider)with LazyLogging {
case class ColIPPParser(override val origin: Origin, override val blameProvider: BlameProvider, val cppOrigin: Option[Origin]) extends Parser(origin, blameProvider) {

override def parse[G](stream: CharStream): ParseResult[G] = {
try {
logger.debug(s"STARTING LEXING")
val lexer = new LangCPPLexer(stream)
logger.debug(s"STARTING TOKEN STREAM")
val tokens = new CommonTokenStream(lexer)
logger.debug(s"STARTING PARSING")
val parser = new CPPParser(tokens)
logger.debug(s"DONE PARSING")

val (errors, tree) = noErrorsOrThrow(origin, parser, lexer) {
logger.debug(s"DONE noErrorsOrThrow")
val errors = expectedErrors(tokens, LangCPPLexer.EXPECTED_ERROR_CHANNEL, LangCPPLexer.VAL_EXPECT_ERROR_OPEN, LangCPPLexer.VAL_EXPECT_ERROR_CLOSE)
logger.debug(s"DONE expectedErrors")
val tree = parser.translationUnit()
logger.debug(s"DONE translationUnit")
(errors, tree)
}
logger.debug(s"STARTING CPPTOCOL")

val decls = CPPToCol[G](origin, blameProvider, errors, cppOrigin.map(o => (tokens, o))).convert(tree)
logger.debug(s"DONE CPPTOCOL")
ParseResult(decls, errors.map(_._3))
} catch {
case m: MatchError =>
Expand Down

0 comments on commit 1e86872

Please sign in to comment.