1
XML 파일의 유효성을 검사하기 위해 다음과 같은 문법이 있습니다. 파일은 요소와 루트 노드로 시작됩니다.YACC 문법 축소/감소 충돌
program
: terminal_node
root
;
root
: '<' ID attribute_list '>' node_list '<' ID '/''>'
;
node_list
: node
| node node_list
;
node
: terminal_node
: nonterminal_node
;
terminal_node
: '<' ID attribute_list '/''>'
;
nonterminal_node
: '<' ID attribute_list '>' node_list '<' ID '/''>'
;
attribute_list
: attribute
| attribute attribute_list
;
attribute
: ID ASSIGNOP '"' ID '"'
| ID ASSIGNOP '"' NUM '"'
;
줄이기/줄이기 충돌이 1 개 발생하며이를 찾는 방법을 모르겠습니다. 어떤 도움을 주시면 감사하겠습니다.
"뿌리"와 "nonterminal_node을"정확히 동일합니다. – wildplasser