bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FYI: lalr1.cc: Move tokens and YYSTYPE into the class


From: Hans Aberg
Subject: Re: FYI: lalr1.cc: Move tokens and YYSTYPE into the class
Date: Sat, 29 Oct 2005 20:00:01 +0200

I think that if the lexer is to be pure, it should have the following structure:

namespace yy {

  class lexer {

  public:
    token_type lex(semantic_type& [,...]);
  };

}

This means that semantic_type must be known to class lexer at least as a reference. So it suggests that also the semantic type should be put in a header, as I suggested. [,...] might contain other data the lexer is communicating with the parser, like the location.

  Hans Aberg






reply via email to

[Prev in Thread] Current Thread [Next in Thread]