Esempio n. 1
0
    {
        echo "exit " . $ruleName . " " . $inputSymbol;
        if ($this->state->failed) {
            echo " failed=" . $this->state->failed;
        }
        if ($this->state->backtracking > 0) {
            echo " backtracking=" . $this->state->backtracking;
        }
        echo "\n";
    }
    /**
     * Use this method in Php.stg: D F A  E X P R E S S I O N S work around
     * to avoid cases with ID, INT, FLOAT in generation of code 
     * statements like 
     * 	($this->input->LA(1)>=INT && $this->input->LA(1)<=FLOAT)
     */
    public function getToken($name)
    {
        if (preg_match("/^\\d+/", $name)) {
            return (int) $name;
        } else {
            return $this->{$name};
        }
    }
    public function getTokenName($tokenId)
    {
    }
}
BaseRecognizer::$DEFAULT_TOKEN_CHANNEL = TokenConst::$DEFAULT_CHANNEL;
BaseRecognizer::$HIDDEN = TokenConst::$HIDDEN_CHANNEL;
Esempio n. 2
0
 public function traceOut($ruleName, $ruleIndex, $inputSymbol = null)
 {
     parent::traceOut($ruleName, $ruleIndex, $this->input->LT(1));
 }
Esempio n. 3
0
 public function traceOut($ruleName, $ruleIndex, $inputSymbol = null)
 {
     $inputSymbol = $this->input->LT(1) . " line=" . $this->getLine() . ":" . $this->getCharPositionInLine();
     parent::traceOut($ruleName, $ruleIndex, $inputSymbol);
 }