Get original text of an Antlr rule
I am an ANTLR beginner and want to calculate a SHA1-Hash of symbols. My simplified example grammar: grammar Example; method @after{calculateSha1($text); }: 'call' ID; ID: 'A'..'Z'+; WS: (' '|'\n'|'\r')+ {skip(); } COMMENT: '/*' (options {greedy=false;}: .)* '*/' {$channel=HIDDEN} As the lexer removes all whitespaces the different strings callABC , call /* DEF */ ABC unfortunately get the same SHA1-Hash value. Is it possible to get the "original" text of a rule between the start- and end-token with all the skipped whitespaces and the text of the other channels? (One possibility that comes into