저는 bison C++ 파서에서 작업하고 있습니다. 대부분의 예제에는 .y 파일에 location&
매개 변수가있는 오류 메서드가 있지만이 메서드를 호출하는 location_type을 얻는 방법을 모르겠습니다. 를 컴파일 할 때 처리 위치 정보 bison C++ 구문 분석기 오류
typedef location location_type;
void
yy::c_parser::error (const location_type& l,
const std::string& m)
{
driver.error (l, m);
}
이
는, 그러나if (!driver.calc.existsVariable(*$1)) {
error(yyloc, std::string("Unknown variable \"") + *$1 + "\"");
http://panthema.net/2007/flex-bison-cpp-example/에서 예를 발췌 한 것입니다, 나는 parser.yy:109: error: ‘yyloc’ was not declared in this scope
있다는 오류가 발생했습니다.
[SO/how-does-flex-support-bison-location-exactly]과 관련이있을 수 있습니다. (http://stackoverflow.com/questions/656703/how-does-flex-support-bison-location-exactly) – Jarod42