2017-05-08 4 views
1

Quex 0.64.8에서 0.67.4로 lexer 파일을 이식하는 동안 문자열 누적 기의 일부 문제로 을 실행했습니다.lexer string accumulator를 Quex의 새 버전으로 이식 할 때의 문제

Severity Code Description Project File Line Suppression State 
Error C3861 'ecmascript_lexer_Accumulator__clear': identifier not found (compiling source file C:\Users\Patrikj\Work\git\ecmascript_build_vc14_x64\generated\ecmascript_lexer.cpp) ktes C:\Users\Patrikj\Work\git\ecmascript\ecmascript.qx 107 

나는 그것이 문제의 원인 이중 밑줄 Accumulator__clear의 가정 : 문제는 I는 다음과 같이 얻을. 아마도 Quex에 새 스위치를 제공해야 할 수도 있고 아니면 API가 최신 버전으로 변경되었을 수도 있습니다. 어느 쪽이든 나는 문제를 해결하는 방법을 놓치고 있습니다. 이 문제를 해결 어떤 도움이 많이 주시면 감사하겠습니다

mode StringHelper : EOF 
<inheritable: only> 
{ 
    on_exit { 
    /// All 3 rows using the accumulator generates an error similiar to the one mentioned above 
    if(self.accumulator.text.begin != self.accumulator.text.end) 
    self_send(TOK_STRLITPART); 

    self_accumulator_flush(TOK_QUOTE); 

    self_accumulator_clear(); 
    } 
} 

: 문제가 발생 내 렉서 (.qx)에서

그리고 예.

안부, 패트릭 J

답변

1

버전 0.67.3 이상에서는 주 발전기에서 문자열 누적 제외. 그 이유는 어떤 상황에서는 구조에 일반적인 해결책이 없기 때문에 포함 푸시, 및 재설정 시나리오가 있습니다. 사용자는 계속 진행하면서 지정해야합니다.

축전지를 사용하는 경우 명령 행 옵션이 필요하지 않습니다. PostCategorizer와

header { 
#include <quex/code_base/extra/accumulator/Accumulator> 
} 

footer { 
#include <quex/code_base/extra/accumulator/Accumulator.i> 
} 
body { 
    QUEX_NAME(Accumulator)   accumulator; 
} 
constructor { 
    if(! QUEX_NAME(Accumulator_construct)(&me->accumulator, me)) { 
     return false; 
    } 
} 
destructor { 
    QUEX_NAME(Accumulator_destruct)(&me->accumulator); 
} 
print { 
    QUEX_NAME(Accumulator_print_this)(&me->accumulator); 
} 

의 경우와 동일하다 : 그러나, .qx 파일의 다음 부분 (이것은 일례이다) 정의 될 필요가있다. 아래설정은 데모 서브 디렉토리의 'common.qx'파일에 있습니다.

또한 'flush()'후에 'clear()'할 필요가 없습니다.

관련 문제