Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Expr {
- enum class Tag {
- Prim,
- Literal,
- Object,
- New,
- Array,
- Ref,
- VectorShortcut,
- Call,
- DotIndex,
- Subscript,
- Instance,
- Assign,
- BinOp,
- Conditional,
- UnOp,
- Closure,
- Seq
- } tag;
- srcspan_t span;
- Expr(Tag tag, srcspan_t span)
- : tag(tag)
- , span(span) {
- }
- };
- SYNTHESIZE_PM_BASE(ExprBase, Expr);
- struct ExprPrim : public ExprBase<Expr::Tag::Prim> {
- enum class Kind {
- Undefined,
- True,
- False,
- Null,
- This,
- Super
- } kind;
- ExprPrim(srcspan_t span, Kind kind) :
- ExprBase(span),
- kind(kind) {
- }
- };
- struct ExprLiteral : public ExprBase<Expr::Tag::Literal> {
- enum class Kind {
- Decimal,
- Hexidecimal,
- String
- } kind;
- StringRef contents;
- ExprLiteral(srcspan_t span, Kind kind, StringRef contents) :
- ExprBase(span),
- kind(kind),
- contents(contents) {
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement