aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/parser/proto_ast/gen/jsonpath/ya.make
blob: 783b5945feb86c47fb295057fc27c9e32e2074c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
PROTO_LIBRARY()

IF (GEN_PROTO)
    SET(antlr_output ${ARCADIA_BUILD_ROOT}/${MODDIR})
    SET(antlr_templates ${antlr_output}/org/antlr/codegen/templates)
    SET(jsonpath_grammar ${ARCADIA_ROOT}/yql/essentials/minikql/jsonpath/JsonPath.g)

    SET(ANTLR_PACKAGE_NAME NJsonPathGenerated)
    SET(PROTOBUF_HEADER_PATH ${MODDIR})
    SET(PROTOBUF_SUFFIX_PATH .pb.h)
    SET(LEXER_PARSER_NAMESPACE NALP)

    CONFIGURE_FILE(${ARCADIA_ROOT}/yql/essentials/parser/proto_ast/org/antlr/codegen/templates/Cpp/Cpp.stg.in ${antlr_templates}/Cpp/Cpp.stg)
    CONFIGURE_FILE(${ARCADIA_ROOT}/yql/essentials/parser/proto_ast/org/antlr/codegen/templates/protobuf/protobuf.stg.in ${antlr_templates}/protobuf/protobuf.stg)

    RUN_ANTLR(
        ${jsonpath_grammar}
        -lib .
        -fo ${antlr_output}
        -language protobuf
        IN ${jsonpath_grammar} ${antlr_templates}/protobuf/protobuf.stg
        OUT_NOAUTO JsonPathParser.proto
        CWD ${antlr_output}
    )

    NO_COMPILER_WARNINGS()

    ADDINCL(
        # TODO Please check RUN_ANTLR with version 3, but ADDINCL for version 4
        GLOBAL contrib/libs/antlr4_cpp_runtime/src
    )

    INCLUDE(${ARCADIA_ROOT}/yql/essentials/parser/proto_ast/org/antlr/codegen/templates/ya.make.incl)

    RUN_ANTLR(
        ${jsonpath_grammar}
        -lib .
        -fo ${antlr_output}
        IN ${jsonpath_grammar} ${antlr_templates}/Cpp/Cpp.stg
        OUT JsonPathParser.cpp JsonPathLexer.cpp JsonPathParser.h JsonPathLexer.h
        OUTPUT_INCLUDES
        JsonPathParser.pb.h
        ${STG_INCLUDES}
        CWD ${antlr_output}
    )
ENDIF()

SRCS(JsonPathParser.proto)

EXCLUDE_TAGS(GO_PROTO JAVA_PROTO)

END()