pypeg

    1

    1답변

    class A(List): grammar = [(Symbol, ':', Symbol), Symbol] compose(parse('a', A)) 구문 분석하는 동안 compose 오류가 발생합니다. 난 단지 더미 클래스를 사용하여 우회 할 수 있습니다 class B(List): grammar = Symbol, ':', Symbol

    3

    1답변

    내가 pypeg를 사용하여 양식 중 하나 $f, $c의 종류, ..., $d 일치하려는, 그래서 다음과 같이 내가 Enum에 넣어 시도 : 그러나 class StatementType(Keyword): grammar = Enum(K("$f"), K("$c"), K("$v"), K("$e"), K("$a"), K("$p