SHARE
TWEET

Untitled

tinyevil Nov 22nd, 2018 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. struct Expr {
  3.     enum class Tag {
  4.         Prim,
  5.         Literal,
  6.         Object,
  7.         New,
  8.         Array,
  9.         Ref,
  10.         VectorShortcut,
  11.         Call,
  12.         DotIndex,
  13.         Subscript,
  14.         Instance,
  15.         Assign,
  16.         BinOp,
  17.         Conditional,
  18.         UnOp,
  19.         Closure,
  20.         Seq
  21.     } tag;
  22.     srcspan_t span;
  23.  
  24.     Expr(Tag tag, srcspan_t span)
  25.         : tag(tag)
  26.         , span(span) {
  27.     }
  28. };
  29. SYNTHESIZE_PM_BASE(ExprBase, Expr);
  30.  
  31. struct ExprPrim : public ExprBase<Expr::Tag::Prim> {
  32.     enum class Kind {
  33.         Undefined,
  34.         True,
  35.         False,
  36.         Null,
  37.         This,
  38.         Super
  39.     } kind;
  40.  
  41.     ExprPrim(srcspan_t span, Kind kind) :
  42.         ExprBase(span),
  43.         kind(kind) {
  44.     }
  45. };
  46.  
  47. struct ExprLiteral : public ExprBase<Expr::Tag::Literal> {
  48.     enum class Kind {
  49.         Decimal,
  50.         Hexidecimal,
  51.         String
  52.     } kind;
  53.     StringRef contents;
  54.  
  55.     ExprLiteral(srcspan_t span, Kind kind, StringRef contents) :
  56.         ExprBase(span),
  57.         kind(kind),
  58.         contents(contents) {
  59.     }
  60. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top