Skip to content

Commit 4ee1a79

Browse files
authored
Fix build antlr4 for sandboxing/windows (#9362)
1 parent 238a753 commit 4ee1a79

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

ydb/library/yql/parser/proto_ast/antlr4/proto_ast_antlr4.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
#include <ydb/library/yql/parser/proto_ast/common.h>
44

5+
#ifdef ERROR
6+
#undef ERROR
7+
#endif
58
#include <contrib/libs/antlr4_cpp_runtime/src/antlr4-runtime.h>
69

710
namespace antlr4 {

ydb/library/yql/parser/proto_ast/gen/v1_antlr4/ya.make

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ADDINCL(
3434
GLOBAL contrib/libs/antlr4_cpp_runtime/src
3535
)
3636

37-
INCLUDE(${ARCADIA_ROOT}/ydb/library/yql/parser/proto_ast/org/antlr/codegen/templates/ya.make.incl)
37+
INCLUDE(${ARCADIA_ROOT}/ydb/library/yql/parser/proto_ast/org/antlr/v4/tool/templates/codegen/ya.make.incl)
3838

3939
RUN_ANTLR4(
4040
${sql_grammar}

ydb/library/yql/parser/proto_ast/org/antlr/v4/tool/templates/codegen/Cpp/Files.stg.in

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ LexerFileHeader(file, lexer, namedActions) ::= <<
4343

4444
<namedActions.preinclude>
4545

46+
#ifdef ERROR
47+
#undef ERROR
48+
#endif
4649
#include "antlr4-runtime.h"
4750

4851
<namedActions.postinclude>
@@ -80,6 +83,9 @@ ParserFileHeader(file, parser, namedActions, contextSuperClass) ::= <<
8083

8184
<namedActions.preinclude>
8285

86+
#ifdef ERROR
87+
#undef ERROR
88+
#endif
8389
#include "antlr4-runtime.h"
8490
#include \<ydb/library/yql/parser/proto_ast/antlr4/proto_ast_antlr4.h>
8591

@@ -121,6 +127,9 @@ BaseListenerFileHeader(file, header, namedActions) ::= <<
121127

122128
<namedActions.baselistenerpreinclude>
123129

130+
#ifdef ERROR
131+
#undef ERROR
132+
#endif
124133
#include "antlr4-runtime.h"
125134
#include "<file.grammarName>Listener.h"
126135

@@ -183,6 +192,9 @@ ListenerFileHeader(file, header, namedActions) ::= <<
183192

184193
<namedActions.listenerpreinclude>
185194

195+
#ifdef ERROR
196+
#undef ERROR
197+
#endif
186198
#include "antlr4-runtime.h"
187199
#include "<file.parserName>.h"
188200

@@ -238,6 +250,9 @@ BaseVisitorFileHeader(file, header, namedActions) ::= <<
238250

239251
<namedActions.basevisitorpreinclude>
240252

253+
#ifdef ERROR
254+
#undef ERROR
255+
#endif
241256
#include "antlr4-runtime.h"
242257
#include "<file.grammarName>Visitor.h"
243258

@@ -296,6 +311,9 @@ VisitorFileHeader(file, header, namedActions) ::= <<
296311

297312
<namedActions.visitorpreinclude>
298313

314+
#ifdef ERROR
315+
#undef ERROR
316+
#endif
299317
#include "antlr4-runtime.h"
300318
#include "<file.parserName>.h"
301319

0 commit comments

Comments
 (0)