Am 21.09.2012 15:11, schrieb Minh Triet Pham Tran:
> I'm having a language lexer assignment (lexer.scala) and I need to
> regconized and ignored the comments from the language but the main.scala
> forced to use println the regconized tokens, this is fixed by my teacher
Then write your lexer in a way that it ignores the comments. That seems
to be the real assignment, not to try to subvert println.
But that still looks slightly funny, the usual approach is to generate
lexer tokens for comments and deal with them in the parser.
- Florian.