Вот мой код:
34
35 /**
36 ** \file position.hh
37 ** Define the example::position class.
38 */
39
40 #ifndef BISON_POSITION_HH
41 #define BISON_POSITION_HH
42
43 #include <iostream>
44 #include <string>
45
46 namespace example
47 {
48 /// Abstract a position.
49 class position
50 {
51 public:
52
53 /// Construct a position.
54 position ()
55 : filename (0), line (1), column (0)
56 {
Спасибо, Спидер, это здорово. Некролис, спасибо тебе тоже. Вы оба, ребята, находитесь на одной и той же дорожке в сборочных единицах. Вот полный отчет об ошибке:
В файле из файла location.hh: 45,
из parser.h: 64,
от scanner.h: 25,
от scanner.ll: 8:
position.hh: 46: ошибка: ожидаемый неквалифицированный идентификатор перед «пространством имен»
location.hh выглядит так:
35 /**
36 ** \file location.hh
37 ** Define the example::location class.
38 */
39
40 #ifndef BISON_LOCATION_HH
41 # define BISON_LOCATION_HH
42
43 # include <iostream>
44 # include <string>
45 # include "position.hh"
46
47 namespace example
48 {
49
50 /// Abstract a location.
51 class location
52 {
53 public:
Я также должен добавить, что эти файлы генерируются зубрами. когда я пытаюсь скомпилировать класс сканера c ++, сгенерированный flex ++, я дохожу до этого этапа. Я получаю код .cc с помощью команды flex --c ++ -o scanner.cc scanner.ll.