Alien-SmokeQt

 view release on metacpan or  search on metacpan

generator/generators/smoke/writeClasses.cpp  view on Meta::CPAN

        out << param.type()->toString() << " x" << i + 1;
        x_params += QString("        x[%1].%2 = %3;\n")
            .arg(QString::number(i + 1)).arg(Util::stackItemField(param.type()))
            .arg(Util::assignmentString(param.type(), "x" + QString::number(i + 1)));
        x_list += "x" + QString::number(i + 1);
    }
    out << ") ";
    if (meth.isConst())
        out << "const ";
    if (meth.hasExceptionSpec()) {
        out << "throw(";
        for (int i = 0; i < meth.exceptionTypes().count(); i++) {
            if (i > 0) out << ", ";
            out << meth.exceptionTypes()[i].toString();
        }
        out << ") ";
    }
    out << "{\n";
    out << QString("        Smoke::StackItem x[%1];\n").arg(meth.parameters().count() + 1);
    out << x_params;
    

generator/generators/smoke/writeClasses.cpp  view on Meta::CPAN

        out << enumCode;
        out << "        }\n";
        out << "    }\n";
    }
    
    // destructor
    // if the class can't be instanstiated, a callback when it's deleted is unnecessary
    if (Util::canClassBeInstanciated(klass)) {
        out << "    ~" << smokeClassName << "() ";
        if (destructor && destructor->hasExceptionSpec()) {
            out << "throw(";
            for (int i = 0; i < destructor->exceptionTypes().count(); i++) {
                if (i > 0) out << ", ";
                out << destructor->exceptionTypes()[i].toString();
            }
            out << ") ";
        }
        out << QString("{ this->_binding->deleted(%1, (void*)this); }\n").arg(m_smokeData->classIndex[className]);
    }
    out << "};\n";
    

generator/parser/ast.h  view on Meta::CPAN

  DECLARE_AST_NODE(TemplateParameter)

  TypeParameterAST *type_parameter; //This is used if this is a template-parameter like "class A"
  ParameterDeclarationAST *parameter_declaration; //This is used if this is a template-parameter like "int a"
};

struct ThrowExpressionAST: public ExpressionAST
{
  DECLARE_AST_NODE(ThrowExpression)

  std::size_t throw_token;
  ExpressionAST *expression;
};

struct TranslationUnitAST: public AST, public CommentAST
{
  DECLARE_AST_NODE(TranslationUnit)

  const ListNode<DeclarationAST*> *declarations;

  ///true if either a '}' was missing at the end, or there was a '}' too much.

generator/parser/codegenerator.cpp  view on Meta::CPAN


  if (node->expression) {
    m_output << "=";

    visit(node->expression);
  }
}

void CodeGenerator::visitExceptionSpecification(ExceptionSpecificationAST* node)
{
  printToken(Token_throw);

  m_output << "(";

  print(node->ellipsis);

  DefaultVisitor::visitExceptionSpecification(node);

  m_output << ")";
}

generator/parser/codegenerator.cpp  view on Meta::CPAN

  visit(node->declaration);
}

void CodeGenerator::visitTemplateParameter(TemplateParameterAST* node)
{
  DefaultVisitor::visitTemplateParameter(node);
}

void CodeGenerator::visitThrowExpression(ThrowExpressionAST* node)
{
  printToken(Token_throw);

  DefaultVisitor::visitThrowExpression(node);
}

void CodeGenerator::visitTranslationUnit(TranslationUnitAST* node)
{
  DefaultVisitor::visitTranslationUnit(node);
}

void CodeGenerator::visitTryBlockStatement(TryBlockStatementAST* node)

generator/parser/lexer.cpp  view on Meta::CPAN

  ADD_TOKEN(signals);
  ADD_TOKEN(signed);
  ADD_TOKEN(sizeof);
  ADD_TOKEN(slots);
  ADD_TOKEN(static);
  ADD_TOKEN(static_cast);
  ADD_TOKEN(struct);
  ADD_TOKEN(switch);
  ADD_TOKEN(template);
  ADD_TOKEN(this);
  ADD_TOKEN(throw);
  ADD_TOKEN(true);
  ADD_TOKEN(try);
  ADD_TOKEN(typedef);
  ADD_TOKEN(typeid);
  ADD_TOKEN(typename);
  ADD_TOKEN(union);
  ADD_TOKEN(unsigned);
  ADD_TOKEN(using);
  ADD_TOKEN(virtual);
  ADD_TOKEN(void);

generator/parser/parser.cpp  view on Meta::CPAN

        case Token_switch:
        case Token_while:
        case Token_do:
        case Token_for:
        case Token_break:
        case Token_continue:
        case Token_return:
        case Token_goto:
        case Token_try:
        case Token_catch:
        case Token_throw:
        case Token_char:
        case Token_size_t:
        case Token_wchar_t:
        case Token_bool:
        case Token_short:
        case Token_int:
        case Token_long:
        case Token_signed:
        case Token_unsigned:
        case Token_float:

generator/parser/parser.cpp  view on Meta::CPAN

    }

  rewind(start);
  return false;
}

bool Parser::parseExceptionSpecification(ExceptionSpecificationAST *&node)
{
  std::size_t start = session->token_stream->cursor();

  CHECK(Token_throw);
  ADVANCE('(', "(");

  ExceptionSpecificationAST *ast
    = CreateNode<ExceptionSpecificationAST>(session->mempool);

  if (session->token_stream->lookAhead() == Token_ellipsis)
    {
      ast->ellipsis = session->token_stream->cursor();
      advance();
    }

generator/parser/parser.cpp  view on Meta::CPAN

}

bool Parser::parseAssignmentExpression(ExpressionAST *&node)
{
  std::size_t start = session->token_stream->cursor();

  if(parseSignalSlotExpression(node))
    return true;
    //Parsed a signal/slot expression, fine

  if (session->token_stream->lookAhead() == Token_throw && !parseThrowExpression(node))
    return false;
  else if (!parseConditionalExpression(node))
    return false;

  while (session->token_stream->lookAhead() == Token_assign
         || session->token_stream->lookAhead() == '=')
    {
      std::size_t op = session->token_stream->cursor();
      advance();

generator/parser/parser.cpp  view on Meta::CPAN


  return true;
}

bool Parser::parseThrowExpression(ExpressionAST *&node)
{
  std::size_t start = session->token_stream->cursor();

  size_t pos = session->token_stream->cursor();

  CHECK(Token_throw);

  ThrowExpressionAST *ast = CreateNode<ThrowExpressionAST>(session->mempool);
  ast->throw_token = pos;

  parseAssignmentExpression(ast->expression);

  UPDATE_POS(ast, start, _M_last_valid_token+1);
  node = ast;

  return true;
}

bool Parser::holdErrors(bool hold)

generator/parser/tokens.cpp  view on Meta::CPAN

  "sizeof",
  "size_t",
  "slots",
  "static",
  "static_cast",
  "string_literal",
  "struct",
  "switch",
  "template",
  "this",
  "throw",
  "true",
  "try",
  "typedef",
  "typeid",
  "typename",
  "union",
  "unsigned",
  "using",
  "virtual",
  "void",

generator/parser/tokens.cpp  view on Meta::CPAN

  "sizeof",
  "size_t",
  "slots",
  "static",
  "static_cast",
  "string_literal",
  "struct",
  "switch",
  "template",
  "this",
  "throw",
  "true",
  "try",
  "typedef",
  "typeid",
  "typename",
  "union",
  "unsigned",
  "using",
  "virtual",
  "void",

generator/parser/tokens.h  view on Meta::CPAN

    Token_sizeof,
    Token_size_t,
    Token_slots,
    Token_static,
    Token_static_cast,
    Token_string_literal,
    Token_struct,
    Token_switch,
    Token_template,
    Token_this,
    Token_throw,
    Token_true,
    Token_try,
    Token_typedef,
    Token_typeid,
    Token_typename,
    Token_union,
    Token_unsigned,
    Token_using,
    Token_virtual,
    Token_void,



( run in 0.319 second using v1.01-cache-2.11-cpan-496ff517765 )