| 1 | // bin/osh_parse_preamble.h: declarations to run osh_parse.mycpp
|
| 2 |
|
| 3 | #include <errno.h>
|
| 4 | #include <fcntl.h> // e.g. F_DUPFD used directly
|
| 5 | #include <fnmatch.h> // FNM_CASEFOLD in osh/sh_expr_eval.py
|
| 6 | #include <glob.h> // GLOB_PERIOD in osh/glob_.py
|
| 7 | #include <regex.h> // REG_ICASE in osh/sh_expr_eval.py
|
| 8 | #include <sys/resource.h> // RLIM_INFINITY in builtin/process_osh.py
|
| 9 | #include <sys/wait.h> // e.g. WIFSIGNALED() called directly
|
| 10 |
|
| 11 | #include "_gen/core/optview.h"
|
| 12 | #include "_gen/core/runtime.asdl.h"
|
| 13 | #include "_gen/core/value.asdl.h"
|
| 14 | #include "_gen/data_lang/nil8.asdl.h"
|
| 15 | #include "_gen/display/pretty.asdl.h"
|
| 16 | #include "_gen/frontend/arg_types.h"
|
| 17 | #include "_gen/frontend/consts.h"
|
| 18 | #include "_gen/frontend/help_meta.h"
|
| 19 | #include "_gen/frontend/id_kind.asdl.h" // syntax.asdl depends on this
|
| 20 | #include "_gen/frontend/option.asdl.h"
|
| 21 | #include "_gen/frontend/signal.h"
|
| 22 | #include "_gen/frontend/syntax.asdl.h"
|
| 23 | #include "_gen/frontend/types.asdl.h"
|
| 24 | #include "_gen/ysh/grammar_nt.h"
|
| 25 | #include "cpp/core.h"
|
| 26 | #include "cpp/data_lang.h"
|
| 27 | #include "cpp/fanos.h"
|
| 28 | #include "cpp/frontend_flag_spec.h"
|
| 29 | #include "cpp/frontend_match.h"
|
| 30 | #include "cpp/frontend_pyreadline.h"
|
| 31 | #include "cpp/libc.h"
|
| 32 | #include "cpp/osh.h"
|
| 33 | #include "cpp/osh_tdop.h"
|
| 34 | #include "cpp/pgen2.h"
|
| 35 | #include "cpp/pylib.h"
|
| 36 | #include "cpp/stdlib.h"
|
| 37 | #include "cpp/translation_stubs.h"
|
| 38 | #include "mycpp/runtime.h" // runtime library e.g. with Python data structures
|
| 39 |
|
| 40 | // Function prototypes are emitted in mycpp's DECL phase, and some of them have
|
| 41 | // default args that reuide this.
|
| 42 |
|
| 43 | using id_kind_asdl::Id;
|
| 44 |
|
| 45 | using hnode_asdl::hnode;
|
| 46 |
|
| 47 | using pretty_asdl::doc;
|
| 48 |
|
| 49 | using runtime_asdl::cmd_value;
|
| 50 | using runtime_asdl::part_value;
|
| 51 | using runtime_asdl::scope_e;
|
| 52 |
|
| 53 | using syntax_asdl::command;
|
| 54 | using syntax_asdl::expr;
|
| 55 | using syntax_asdl::loc;
|
| 56 | using syntax_asdl::printf_part; // added when self._Percent() used it in
|
| 57 | // function signature
|
| 58 | using syntax_asdl::proc_sig;
|
| 59 | using syntax_asdl::suffix_op;
|
| 60 | using syntax_asdl::word;
|
| 61 | using syntax_asdl::word_part;
|
| 62 |
|
| 63 | using types_asdl::lex_mode_e;
|
| 64 |
|
| 65 | using value_asdl::sh_lvalue; // for builtin_assign.py and builtin_misc.py
|
| 66 | using value_asdl::value;
|
| 67 |
|
| 68 | // Added for osh_parse
|
| 69 |
|
| 70 | // TODO: we need to export headers somehow?
|
| 71 | // core/vm.py imports many types
|
| 72 |
|
| 73 | namespace cmd_eval {
|
| 74 | class CommandEvaluator;
|
| 75 | };
|
| 76 |
|
| 77 | namespace expr_eval {
|
| 78 | class ExprEvaluator;
|
| 79 | };
|
| 80 |
|
| 81 | namespace sh_expr_eval {
|
| 82 | class EnvConfig;
|
| 83 | };
|
| 84 |
|
| 85 | namespace sh_expr_eval {
|
| 86 | class ArithEvaluator;
|
| 87 | class BoolEvaluator;
|
| 88 | class UnsafeArith;
|
| 89 | };
|
| 90 |
|
| 91 | namespace word_eval {
|
| 92 | class NormalWordEvaluator;
|
| 93 | };
|