mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-09 17:52:08 -10:00
This adds an Antlr grammar for parsing argument lists instead of using a hand written parser. This allows to write much more complicated syntax constructs and have all the code being auto-generated. It will also produce a much more correct parser instead of having all those hacks in the hand-written one. This also adds (in addition to supporting the previous syntax) support for function types along with support for them in HTML and JSON output formats. The ANTLR generated parser is included in source form so that it is not necessary to have an ANTLR installation around if you are not going to change the grammar. Also includes the necessary runtime code from Antlr.
27 lines
428 B
C++
27 lines
428 B
C++
#pragma once
|
|
|
|
#include "globalincs/pstypes.h"
|
|
|
|
#include "ade_doc.h"
|
|
|
|
namespace scripting {
|
|
|
|
struct argument_def {
|
|
ade_type_info type;
|
|
SCP_string name;
|
|
SCP_string def_val;
|
|
bool optional = false;
|
|
};
|
|
|
|
class argument_list_parser {
|
|
public:
|
|
bool parse(const SCP_string& argumentList);
|
|
|
|
const SCP_vector<scripting::argument_def>& getArgList() const;
|
|
|
|
private:
|
|
SCP_vector<argument_def> _argList;
|
|
};
|
|
|
|
} // namespace scripting
|