Exemplo n.º 1
0
    def enterVariableName(self,
                          ctx: GccOptionsParser.VariableNameContext) -> None:
        """
        Handle entry to the VariableName token.

        If the variable name is a language of interest, add it to the list.

        :param ctx: The rule invocation context. Contains relevant information
            about the rule from parsing.
        """
        if ctx.getText() in INTERESTING_LANGUAGES:
            self.languages.add(ctx.getText())
Exemplo n.º 2
0
    def enterVariableName(self,
                          ctx: GccOptionsParser.VariableNameContext) -> None:
        """
        Handle entry to the VariableName token.

        If the variable name is Warning, mark the warning as such. Otherwise,
        track the variable name for use by enterAtom.

        :param ctx: The rule invocation context. Contains relevant information
            about the rule from parsing.
        """
        if ctx.getText() == "Warning":
            self.is_warning = True
        elif ctx.getText() == "Var":
            self._last_name = "Var"
Exemplo n.º 3
0
    def enterVariableName(self,
                          ctx: GccOptionsParser.VariableNameContext) -> None:
        """
        Handle entry to the VariableName token.

        Track the variable name for use by enterAtom. If the variable name
        indicates the warning is not on-off, mark the warning as such.

        :param ctx: The rule invocation context. Contains relevant information
            about the rule from parsing.
        """
        if ctx.getText() == "Init":
            self._last_name = "Init"
        elif ctx.getText() in ("Enum", "Host_Wide_Int", "Joined", "UInteger"):
            self._is_boolean = False
Exemplo n.º 4
0
    def enterVariableName(self,
                          ctx: GccOptionsParser.VariableNameContext) -> None:
        """
        Handle entry to the VariableName token.

        If the variable name is Ignore, mark the warning as a dummy.

        :param ctx: The rule invocation context. Contains relevant information
            about the rule from parsing.
        """
        if ctx.getText() == "Ignore":
            self.is_dummy = True
Exemplo n.º 5
0
    def enterVariableName(self,
                          ctx: GccOptionsParser.VariableNameContext) -> None:
        """
        Handle entry to the VariableName token.

        If the variable name indicates deprecation, track the warning as such.

        :param ctx: The rule invocation context. Contains relevant information
            about the rule from parsing.
        """
        if ctx.getText() in ("Deprecated", "WarnRemoved"):
            self._deprecated = True
Exemplo n.º 6
0
    def enterVariableName(self,
                          ctx: GccOptionsParser.VariableNameContext) -> None:
        """
        Handle entry to the VariableName token.

        Track the variable name for use by enterAtom.

        :param ctx: The rule invocation context. Contains relevant information
            about the rule from parsing.
        """
        if ctx.getText() == "EnabledBy":
            self._last_name = "EnabledBy"
Exemplo n.º 7
0
    def enterVariableName(self,
                          ctx: GccOptionsParser.VariableNameContext) -> None:
        """
        Handle entry to the VariableName token.

        Track the variable name, and reset the argument index, for use by
        enterAtom.

        :param ctx: The rule invocation context. Contains relevant information
            about the rule from parsing.
        """
        self._last_name = ctx.getText()
        self._argument_id = 0
Exemplo n.º 8
0
    def enterVariableName(self,
                          ctx: GccOptionsParser.VariableNameContext) -> None:
        """
        Handle entry to the VariableName token.

        Track the variable name for use by enterAtom. On entry to IntegerRange,
        ensure the list of collected atoms is empty.

        :param ctx: The rule invocation context. Contains relevant information
            about the rule from parsing.
        """
        self._variable_name = ctx.getText()
        if self._variable_name == "IntegerRange":
            self._atoms.clear()