当前位置: 首页>>代码示例>>C++>>正文


C++ SimpleIdentifierPtr::lexeme方法代码示例

本文整理汇总了C++中SimpleIdentifierPtr::lexeme方法的典型用法代码示例。如果您正苦于以下问题:C++ SimpleIdentifierPtr::lexeme方法的具体用法?C++ SimpleIdentifierPtr::lexeme怎么用?C++ SimpleIdentifierPtr::lexeme使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SimpleIdentifierPtr的用法示例。


在下文中一共展示了SimpleIdentifierPtr::lexeme方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

        void Composition::
        begin (SimpleIdentifierPtr const& id, Category::Value c)
        {
          if (ctx.trace ()) cerr << "composition " << id << endl;

          if(c == Category::entity)
          {
            now (ctx.tu ().new_node<EntityComposition> (
                   ctx.file (), id->line ()));
          }
          else if (c == Category::process)
          {
            now (ctx.tu ().new_node<ProcessComposition> (
                   ctx.file (), id->line ()));
          }
          else if (c == Category::service)
          {
            now (ctx.tu ().new_node<ServiceComposition> (
                   ctx.file (), id->line ()));
          }
          else
          {
            now (ctx.tu ().new_node<SessionComposition> (
                   ctx.file (), id->line ()));
          }

          ctx.tu ().new_edge<Defines> (ctx.scope (), now (), id->lexeme ());
        }
开发者ID:DOCGroup,项目名称:XSC,代码行数:28,代码来源:Composition.cpp

示例2: name

        void Operation::
        name (SimpleIdentifierPtr const& id)
        {
          if (ctx.trace ()) cerr << " " << id << endl;

          if (one_way_)
          {
            if (dynamic_cast<Void*> (type_) == 0)
            {
              cerr << ctx.file () << ":" << id->line () << ": error: "
                   << "invalid operation declaration" << endl;

              cerr << ctx.file () << ":" << id->line () << ": error: "
                   << "oneway operation should have void as a return type"
                   << endl;
            }

            op_ = &ctx.tu ().new_node<OneWayOperation> (
              ctx.file (), id->line ());
          }
          else
            op_ = &ctx.tu ().new_node<TwoWayOperation> (
              ctx.file (), id->line ());

          SimpleName name (id->lexeme ());
          ctx.tu ().new_edge<Defines> (ctx.scope (), *op_, name);

          if (type_)
          {
            ctx.tu ().new_edge<Returns> (*op_, *type_);
          }
        }
开发者ID:EnasAlikhashashashneh,项目名称:OASIS,代码行数:32,代码来源:Operation.cpp

示例3: name

        void EventTypeFactory::
        parameter (IdentifierPtr const& type_id,
                   SimpleIdentifierPtr const& name_id)
        {
          if (ctx.trace ()) cerr << "parameter in " << " "
                                 << type_id << " " << name_id << endl;

          if (f_ == 0) return;

          Name name (type_id->lexeme ());
          ScopedName from (ctx.scope ().scoped_name ());

          try
          {
            try
            {
              Type& t (resolve<Type> (from, name, Flags::complete));

              Parameter& p (
                ctx.tu ().new_node<InParameter> (
                  ctx.file (), name_id->line (), name_id->lexeme ()));

              ctx.tu ().new_edge<Belongs> (p, t);
              ctx.tu ().new_edge<Receives> (*f_, p);
            }
            catch (Resolve const&)
            {
              cerr << ctx.file () << ":" << type_id->line () << ": error: "
                   << "invalid parameter declaration" << endl;
              throw;
            }
          }
          catch (NotFound const&)
          {
            cerr << ctx.file () << ":" << type_id->line () << ": error: "
                 << "no type with name \'" << name
                 << "\' visible from scope \'" << from << "\'" << endl;
          }
          catch (WrongType const&)
          {
            cerr << ctx.file () << ":" << type_id->line () << ": error: "
                 << "declaration with name \'" << name
                 << "\' visible from scope \'" << from
                 << "\' is not a type declaration" << endl;

            cerr << ctx.file () << ":" << type_id->line () << ": error: "
                 << "using non-type as an factory parameter type is "
                 << "illegal" << endl;
          }
          catch (NotComplete const& e)
          {
            cerr << ctx.file () << ":" << type_id->line () << ": error: "
                 << "type \'" << e.name () << "\' is not complete" << endl;
          }
        }
开发者ID:DOCGroup,项目名称:XSC,代码行数:55,代码来源:EventTypeFactory.cpp

示例4: name

        void Native::
        name (SimpleIdentifierPtr const& id)
        {
          if (ctx.trace ()) cerr << "native " << id << endl;

          SimpleName name (id->lexeme ());

          SemanticGraph::Native& n (
            ctx.tu ().new_node<SemanticGraph::Native> (
              ctx.file (), id->line ()));

          ctx.tu ().new_edge<Defines> (ctx.scope (), n, name);
        }
开发者ID:EnasAlikhashashashneh,项目名称:OASIS,代码行数:13,代码来源:Native.cpp

示例5: name

void Enum::
begin (SimpleIdentifierPtr const& id)
{
    if (ctx.trace ()) cerr << "enum " << id << endl;

    type_ = 0;

    SimpleName name (id->lexeme ());

    type_ = &ctx.tu ().new_node<SemanticGraph::Enum> (
                ctx.file (), id->line ());

    ctx.tu ().new_edge<Defines> (ctx.scope (), *type_, name);
}
开发者ID:jwillemsen,项目名称:XSC,代码行数:14,代码来源:Enum.cpp

示例6: name

        void Publishes::
        name (SimpleIdentifierPtr const& id)
        {
          if (ctx.trace ()) cerr << " " << id << endl;

          if (type_)
          {
            Publisher& p (
              ctx.tu ().new_node<Publisher> (
                ctx.file (), id->line ()));

            ctx.tu ().new_edge<Belongs> (p, *type_);
            ctx.tu ().new_edge<Defines> (ctx.scope (), p, id->lexeme ());
          }
        }
开发者ID:DOCGroup,项目名称:XSC,代码行数:15,代码来源:Publishes.cpp

示例7: name

void Typedef::
declarator (SimpleIdentifierPtr const& id)
{
    if (ctx.trace ()) cerr << " " << id << endl;

    SimpleName name (id->lexeme ());

    try
    {
        if (lookup (ctx.tu (), ctx.scope (), name) == 0)
        {
            if (array_type_ != 0)
            {
                assert (define_);

                ctx.tu ().new_edge<Defines> (ctx.scope (), *array_type_, name);

                define_ = false;
                array_type_ = 0;
            }
            else if (type_ != 0)
            {
                if (define_)
                {
                    ctx.tu ().new_edge<Defines> (ctx.scope (), *type_, name);
                    define_ = false;
                }
                else
                {
                    ctx.tu ().new_edge<Aliases> (ctx.scope (), *type_, name);
                }
            }
            return;
        }
    }
    catch (NotUnique const& )
    {
    }

    cerr << ctx.file () << ":" << id->line () << ": error: "
         << "invalid typedef declaration" << endl;

    cerr << ctx.file () << ":" << id->line () << ": error: "
         << "redeclaration of name " << name << endl;

    array_type_ = 0;
}
开发者ID:EnasAlikhashashashneh,项目名称:OASIS,代码行数:47,代码来源:Typedef.cpp

示例8: name

        void Member::
        name (SimpleIdentifierPtr const& id)
        {
          if (ctx.trace ()) cerr << " " << id << endl;

          if (type_)
          {
            SimpleName name (id->lexeme ());

            SemanticGraph::Member& m (
              ctx.tu ().new_node<SemanticGraph::Member> (
                ctx.file (), id->line ()));

            ctx.tu ().new_edge<Belongs> (m, *type_);
            ctx.tu ().new_edge<Defines> (ctx.scope (), m, name);
          }
        }
开发者ID:SEDS,项目名称:CUTS,代码行数:17,代码来源:Member.cpp

示例9: name

        void Union::
        begin_fwd (SimpleIdentifierPtr const& id)
        {
          if (ctx.trace ()) cerr << "union fwd " << id << endl;

          SimpleName name (id->lexeme ());

          if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
          {
            now (dynamic_cast<SemanticGraph::Union&>(*s));
          }
          else
          {
            now (ctx.tu ().new_node<SemanticGraph::Union> (
                   ctx.file (), id->line ()));
          }

          ctx.tu ().new_edge<Mentions> (ctx.scope (), now (), name);
        }
开发者ID:SEDS,项目名称:CUTS,代码行数:19,代码来源:Union.cpp

示例10: name

        void Component::
        begin_def (SimpleIdentifierPtr const& id)
        {
          if (ctx.trace ()) cerr << "component def " << id << endl;

          SimpleName name (id->lexeme ());

          if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
          {
            now (dynamic_cast<SemanticGraph::Component&>(*s));
          }
          else
          {
            now (ctx.tu ().new_node<SemanticGraph::Component> (
                   ctx.file (), id->line ()));
          }

          ctx.tu ().new_edge<Defines> (ctx.scope (), now (), name);
        }
开发者ID:DOCGroup,项目名称:XSC,代码行数:19,代码来源:Component.cpp

示例11: name

        void Interface::
        begin_local_fwd (SimpleIdentifierPtr const& id)
        {
          if (ctx.trace ()) cerr << "local interface fwd " << id << endl;

          SimpleName name (id->lexeme ());

          if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
          {
            now (dynamic_cast<LocalInterface&>(*s));
          }
          else
          {
            now (ctx.tu ().new_node<LocalInterface> (
                   ctx.file (), id->line ()));
          }

          ctx.tu ().new_edge<Mentions> (ctx.scope (), now (), name);
        }
开发者ID:EnasAlikhashashashneh,项目名称:OASIS,代码行数:19,代码来源:Interface.cpp

示例12: name

        void HomeFinder::
        name (SimpleIdentifierPtr const& id)
        {
          if (ctx.trace ()) cerr << " " << id << endl;

          hf_ = 0;

          SemanticGraph::Home& h (
            dynamic_cast<SemanticGraph::Home&>(ctx.scope ()));

          SemanticGraph::Component& c (
            dynamic_cast<SemanticGraph::Component&>(h.manages ().managee ()));

          SimpleName name (id->lexeme ());

          hf_ = &ctx.tu ().new_node<SemanticGraph::HomeFinder> (
            ctx.file (), id->line ());

          ctx.tu ().new_edge<Returns> (*hf_, c);
          ctx.tu ().new_edge<Defines> (ctx.scope (), *hf_, name);
        }
开发者ID:DOCGroup,项目名称:XSC,代码行数:21,代码来源:HomeFinder.cpp

示例13: name

        void ValueTypeMember::
        name (SimpleIdentifierPtr const& id)
        {
          using namespace SemanticGraph;

          if (ctx.trace ()) cerr << " name: " << id << endl;

          if (type_)
          {
            SimpleName name (id->lexeme ());

            SemanticGraph::ValueTypeMember* m;

            switch (access_)
            {
            case SemanticGraph::ValueTypeMember::Access::private_:
              {
                m = &ctx.tu ().new_node<ValueTypePrivateMember> (
                  ctx.file (), id->line ());
                break;
              }
            case SemanticGraph::ValueTypeMember::Access::public_:
              {
                m = &ctx.tu ().new_node<ValueTypePublicMember> (
                  ctx.file (), id->line ());
                break;
              }
            default:
              {
                abort ();
              }
            }

            ctx.tu ().new_edge<Belongs> (*m, *type_);
            ctx.tu ().new_edge<Defines> (ctx.scope (), *m, name);
          }
        }
开发者ID:EnasAlikhashashashneh,项目名称:OASIS,代码行数:37,代码来源:ValueTypeMember.cpp


注:本文中的SimpleIdentifierPtr::lexeme方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。