2012-06-29 3 views
1

flex를 기반으로 한 CSS2.1 렉시 컬 스캐너를 만들고 싶습니다. w3 org에는 스캐너 플렉스 구현이 있습니다. 내가없는 식별자를 선언해야합니다 어떻게flex/lex에서 식별자를 어떻게 선언합니까?

css2.1.flex: In function ‘yylex’: 
css2.1.flex:53:9: error: ‘S’ undeclared (first use in this function) 
css2.1.flex:53:9: note: each undeclared identifier is reported only once for each function it appears in 
css2.1.flex:58:9: error: ‘CDO’ undeclared (first use in this function) 
css2.1.flex:59:9: error: ‘CDC’ undeclared (first use in this function) 
css2.1.flex:60:9: error: ‘INCLUDES’ undeclared (first use in this function) 
css2.1.flex:61:9: error: ‘DASHMATCH’ undeclared (first use in this function) 
css2.1.flex:63:9: error: ‘STRING’ undeclared (first use in this function) 
css2.1.flex:64:9: error: ‘BAD_STRING’ undeclared (first use in this function) 
css2.1.flex:66:9: error: ‘IDENT’ undeclared (first use in this function) 
css2.1.flex:68:9: error: ‘HASH’ undeclared (first use in this function) 
css2.1.flex:70:9: error: ‘IMPORT_SYM’ undeclared (first use in this function) 
css2.1.flex:71:9: error: ‘PAGE_SYM’ undeclared (first use in this function) 
css2.1.flex:72:9: error: ‘MEDIA_SYM’ undeclared (first use in this function) 
css2.1.flex:73:9: error: ‘CHARSET_SYM’ undeclared (first use in this function) 
css2.1.flex:75:9: error: ‘IMPORTANT_SYM’ undeclared (first use in this function) 
css2.1.flex:77:9: error: ‘EMS’ undeclared (first use in this function) 
css2.1.flex:78:9: error: ‘EXS’ undeclared (first use in this function) 
css2.1.flex:79:9: error: ‘LENGTH’ undeclared (first use in this function) 
css2.1.flex:85:9: error: ‘ANGLE’ undeclared (first use in this function) 
css2.1.flex:88:9: error: ‘TIME’ undeclared (first use in this function) 
css2.1.flex:90:9: error: ‘FREQ’ undeclared (first use in this function) 
css2.1.flex:92:9: error: ‘DIMENSION’ undeclared (first use in this function) 
css2.1.flex:94:9: error: ‘PERCENTAGE’ undeclared (first use in this function) 
css2.1.flex:95:9: error: ‘NUMBER’ undeclared (first use in this function) 
css2.1.flex:97:9: error: ‘URI’ undeclared (first use in this function) 
css2.1.flex:99:9: error: ‘BAD_URI’ undeclared (first use in this function) 
css2.1.flex:101:9: error: ‘FUNCTION’ undeclared (first use in this function) 

: 나는

$ flex css2.1.flex 
$ gcc lex.yy.c -lfl 

를 호출하지만 오류를 얻을려고?

답변

2

링크의 flex 구문 바로 앞에있는 구문 분석기 정의에서 정의됩니다. 파서 정의에서 bison -d과 같은 것을 실행하면 정의가 포함 된 파일 (보통 y.tab.h)이 생성됩니다.

관련 문제