In the file AST.h in toy tutorial chapter - 1, the class LiteralExprAST is defined as follows:
/// Expression class for a literal value.
class LiteralExprAST : public ExprAST {
std::vector<std::unique_ptr<ExprAST>> values;
std::vector<int64_t> dims;
public:
LiteralExprAST(Location loc, std::vector<std::unique_ptr<ExprAST>> values,
std::vector<int64_t> dims)
: ExprAST(Expr_Literal, std::move(loc)), values(std::move(values)),
dims(std::move(dims)) {}
llvm::ArrayRef<std::unique_ptr<ExprAST>> getValues() { return values; }
llvm::ArrayRef<int64_t> getDims() { return dims; }
/// LLVM style RTTI
static bool classof(const ExprAST *c) { return c->getKind() == Expr_Literal; }
};
I couldn’t understand what is ‘values’ and ‘dims’ in this class? Can anyone please give an example of how values and dims will be extracted from a literal expression in the source code?
Thanks.