mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-03-13 15:41:50 +01:00
First merge of 2.064 beta.
This corresponds to DMD commit a913ce4bc59a94a022a27e390fc841f4aededffb. Doesn't build Phobos yet.
This commit is contained in:
committed by
Kai Nacke
parent
c400d180d2
commit
cb341586e3
81
dmd2/parse.h
81
dmd2/parse.h
@@ -19,32 +19,32 @@
|
||||
#include "lexer.h"
|
||||
#include "enum.h"
|
||||
|
||||
struct Type;
|
||||
struct TypeQualified;
|
||||
struct Expression;
|
||||
struct Declaration;
|
||||
struct Statement;
|
||||
struct Import;
|
||||
struct Initializer;
|
||||
struct FuncDeclaration;
|
||||
struct CtorDeclaration;
|
||||
struct PostBlitDeclaration;
|
||||
struct DtorDeclaration;
|
||||
struct StaticCtorDeclaration;
|
||||
struct StaticDtorDeclaration;
|
||||
struct SharedStaticCtorDeclaration;
|
||||
struct SharedStaticDtorDeclaration;
|
||||
struct ConditionalDeclaration;
|
||||
struct InvariantDeclaration;
|
||||
struct UnitTestDeclaration;
|
||||
struct NewDeclaration;
|
||||
struct DeleteDeclaration;
|
||||
struct Condition;
|
||||
struct Module;
|
||||
class Type;
|
||||
class TypeQualified;
|
||||
class Expression;
|
||||
class Declaration;
|
||||
class Statement;
|
||||
class Import;
|
||||
class Initializer;
|
||||
class FuncDeclaration;
|
||||
class CtorDeclaration;
|
||||
class PostBlitDeclaration;
|
||||
class DtorDeclaration;
|
||||
class StaticCtorDeclaration;
|
||||
class StaticDtorDeclaration;
|
||||
class SharedStaticCtorDeclaration;
|
||||
class SharedStaticDtorDeclaration;
|
||||
class ConditionalDeclaration;
|
||||
class InvariantDeclaration;
|
||||
class UnitTestDeclaration;
|
||||
class NewDeclaration;
|
||||
class DeleteDeclaration;
|
||||
class Condition;
|
||||
class Module;
|
||||
struct ModuleDeclaration;
|
||||
struct TemplateDeclaration;
|
||||
struct TemplateInstance;
|
||||
struct StaticAssert;
|
||||
class TemplateDeclaration;
|
||||
class TemplateInstance;
|
||||
class StaticAssert;
|
||||
|
||||
/************************************
|
||||
* These control how parseStatement() works.
|
||||
@@ -60,19 +60,20 @@ enum ParseStatementFlags
|
||||
};
|
||||
|
||||
|
||||
struct Parser : Lexer
|
||||
class Parser : public Lexer
|
||||
{
|
||||
public:
|
||||
ModuleDeclaration *md;
|
||||
enum LINK linkage;
|
||||
LINK linkage;
|
||||
Loc endloc; // set to location of last right curly
|
||||
int inBrackets; // inside [] of array index or slice
|
||||
Loc lookingForElse; // location of lonely if looking for an else
|
||||
|
||||
Parser(Module *module, unsigned char *base, size_t length, int doDocComment);
|
||||
Parser(Module *module, utf8_t *base, size_t length, int doDocComment);
|
||||
|
||||
Dsymbols *parseModule();
|
||||
Dsymbols *parseDeclDefs(int once, Dsymbol **pLastDecl = NULL);
|
||||
Dsymbols *parseAutoDeclarations(StorageClass storageClass, unsigned char *comment);
|
||||
Dsymbols *parseAutoDeclarations(StorageClass storageClass, utf8_t *comment);
|
||||
Dsymbols *parseBlock(Dsymbol **pLastDecl);
|
||||
void composeStorageClass(StorageClass stc);
|
||||
StorageClass parseAttribute(Expressions **pexps);
|
||||
@@ -88,7 +89,7 @@ struct Parser : Lexer
|
||||
StaticAssert *parseStaticAssert();
|
||||
TypeQualified *parseTypeof();
|
||||
Type *parseVector();
|
||||
enum LINK parseLinkage();
|
||||
LINK parseLinkage();
|
||||
Condition *parseDebugCondition();
|
||||
Condition *parseVersionCondition();
|
||||
Condition *parseStaticIfCondition();
|
||||
@@ -111,20 +112,20 @@ struct Parser : Lexer
|
||||
Type *parseBasicType();
|
||||
Type *parseBasicType2(Type *t);
|
||||
Type *parseDeclarator(Type *t, Identifier **pident, TemplateParameters **tpl = NULL, StorageClass storage_class = 0, int* pdisable = NULL);
|
||||
Dsymbols *parseDeclarations(StorageClass storage_class, unsigned char *comment);
|
||||
Dsymbols *parseDeclarations(StorageClass storage_class, utf8_t *comment);
|
||||
void parseContracts(FuncDeclaration *f);
|
||||
void checkDanglingElse(Loc elseloc);
|
||||
/** endPtr used for documented unittests */
|
||||
Statement *parseStatement(int flags, unsigned char** endPtr = NULL);
|
||||
Statement *parseStatement(int flags, utf8_t** endPtr = NULL);
|
||||
Initializer *parseInitializer();
|
||||
Expression *parseDefaultInitExp();
|
||||
void check(Loc loc, enum TOK value);
|
||||
void check(enum TOK value);
|
||||
void check(enum TOK value, const char *string);
|
||||
void checkParens(enum TOK value, Expression *e);
|
||||
int isDeclaration(Token *t, int needId, enum TOK endtok, Token **pt);
|
||||
void check(Loc loc, TOK value);
|
||||
void check(TOK value);
|
||||
void check(TOK value, const char *string);
|
||||
void checkParens(TOK value, Expression *e);
|
||||
int isDeclaration(Token *t, int needId, TOK endtok, Token **pt);
|
||||
int isBasicType(Token **pt);
|
||||
int isDeclarator(Token **pt, int *haveId, int *haveTpl, enum TOK endtok);
|
||||
int isDeclarator(Token **pt, int *haveId, int *haveTpl, TOK endtok);
|
||||
int isParameters(Token **pt);
|
||||
int isExpression(Token **pt);
|
||||
int skipParens(Token *t, Token **pt);
|
||||
@@ -154,7 +155,7 @@ struct Parser : Lexer
|
||||
|
||||
Expression *parseNewExp(Expression *thisexp);
|
||||
|
||||
void addComment(Dsymbol *s, unsigned char *blockComment);
|
||||
void addComment(Dsymbol *s, utf8_t *blockComment);
|
||||
};
|
||||
|
||||
// Operator precedence - greater values are higher precedence
|
||||
@@ -180,7 +181,7 @@ enum PREC
|
||||
PREC_primary,
|
||||
};
|
||||
|
||||
extern enum PREC precedence[TOKMAX];
|
||||
extern PREC precedence[TOKMAX];
|
||||
|
||||
void initPrecedence();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user