Displaying 1 result from an estimated 1 matches for "parseglobalexpr".
2011 Feb 08
1
[LLVMdev] Question about linker error
...ls
class GlobalExprAST : public ExprAST {
std::string Name;
ExprAST *Init;
public:
GlobalExprAST(const std::string &name, ExprAST *init)
: Name(name), Init(init) {}
virtual Value *Codegen();
};
/// Parser
/// ::= 'global' identifier ('=' expression)?
static ExprAST *ParseGlobalExpr() {
getNextToken();
std::string Name = IdentifierStr;
getNextToken();
ExprAST *Init = 0;
if (CurTok == '=') {
getNextToken();
Init = ParseExpression();
if (Init == 0) return 0;
}
return new GlobalExprAST(Name, Init);
}
Any help would be much a...