| 1 |
# Copyright (c) 2022-2025, PostgreSQL Global Development Group |
| 2 |
|
| 3 |
backend_sources += files( |
| 4 |
'analyze.c', |
| 5 |
'parse_agg.c', |
| 6 |
'parse_clause.c', |
| 7 |
'parse_coerce.c', |
| 8 |
'parse_collate.c', |
| 9 |
'parse_cte.c', |
| 10 |
'parse_enr.c', |
| 11 |
'parse_expr.c', |
| 12 |
'parse_func.c', |
| 13 |
'parse_jsontable.c', |
| 14 |
'parse_merge.c', |
| 15 |
'parse_node.c', |
| 16 |
'parse_oper.c', |
| 17 |
'parse_param.c', |
| 18 |
'parse_relation.c', |
| 19 |
'parse_target.c', |
| 20 |
'parse_type.c', |
| 21 |
'parse_utilcmd.c', |
| 22 |
'scansup.c', |
| 23 |
) |
| 24 |
|
| 25 |
# Build a small utility static lib for the parser. The generation of the |
| 26 |
# parser is slow, and building this separately avoids other parts of the |
| 27 |
# backend having to wait till gram.h is generated. |
| 28 |
parser_sources = files('parser.c') |
| 29 |
|
| 30 |
backend_scanner = custom_target('scan', |
| 31 |
input: 'scan.l', |
| 32 |
output: 'scan.c', |
| 33 |
command: [flex_cmd, '--no-backup', '--', '-CF', '-p', '-p'], |
| 34 |
) |
| 35 |
generated_sources += backend_scanner |
| 36 |
parser_sources += backend_scanner |
| 37 |
|
| 38 |
backend_parser = custom_target('gram', |
| 39 |
input: 'gram.y', |
| 40 |
kwargs: bison_kw, |
| 41 |
) |
| 42 |
generated_sources += backend_parser.to_list() |
| 43 |
parser_sources += backend_parser |
| 44 |
|
| 45 |
parser = static_library('parser', |
| 46 |
parser_sources, |
| 47 |
dependencies: [backend_code], |
| 48 |
include_directories: include_directories('.'), |
| 49 |
kwargs: internal_lib_args, |
| 50 |
) |
| 51 |
backend_link_with += parser |