public ConstantExpression GetLiteral()

in src/main/csharp/Selector/SelectorParser.cs [470:513]


  public ConstantExpression GetLiteral() {
    Token t;
    string s;
    ConstantExpression left = null;
    switch ((mcc_ntk==-1)?mcc_mntk():mcc_ntk) {
    case STRING_LITERAL:
      s = GetStringLitteral();
                left = new ConstantExpression(s);
      break;
    case DECIMAL_LITERAL:
      t = mcc_consume_token(DECIMAL_LITERAL);
                left = ConstantExpression.CreateFromDecimal(t.image);
      break;
    case HEX_LITERAL:
      t = mcc_consume_token(HEX_LITERAL);
                left = ConstantExpression.CreateFromHex(t.image);
      break;
    case OCTAL_LITERAL:
      t = mcc_consume_token(OCTAL_LITERAL);
                left = ConstantExpression.CreateFromOctal(t.image);
      break;
    case FLOATING_POINT_LITERAL:
      t = mcc_consume_token(FLOATING_POINT_LITERAL);
                left = ConstantExpression.CreateFloat(t.image);
      break;
    case TRUE:
      mcc_consume_token(TRUE);
                left = ConstantExpression.TRUE;
      break;
    case FALSE:
      mcc_consume_token(FALSE);
                left = ConstantExpression.FALSE;
      break;
    case NULL:
      mcc_consume_token(NULL);
                left = ConstantExpression.NULL;
      break;
    default:
      mcc_consume_token(-1);
      throw new ParseException();
    }
        {return left;}
    throw new Exception("Missing return statement in function");
  }