• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ idLexer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中idLexer的典型用法代码示例。如果您正苦于以下问题:C++ idLexer类的具体用法?C++ idLexer怎么用?C++ idLexer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: ParsePlanes

/*
================
idAASFileLocal::ParsePlanes
================
*/
bool idAASFileLocal::ParsePlanes( idLexer &src )
{
    int numPlanes, i;
    idPlane plane;
    idVec4 vec;

    numPlanes = src.ParseInt();
    planeList.Resize( numPlanes );
    if ( !src.ExpectTokenString( "{" ) )
    {
        return false;
    }
    for ( i = 0; i < numPlanes; i++ )
    {
        src.ParseInt();
        if ( !src.Parse1DMatrix( 4, vec.ToFloatPtr() ) )
        {
            return false;
        }
        plane.SetNormal( vec.ToVec3() );
        plane.SetDist( vec[3] );
        planeList.Append( plane );
    }
    if ( !src.ExpectTokenString( "}" ) )
    {
        return false;
    }
    return true;
}
开发者ID:revelator,项目名称:Revelator-Doom3,代码行数:34,代码来源:AASFile.cpp


示例2: ParseReachabilities

/*
================
idAASFileLocal::ParseReachabilities
================
*/
bool idAASFileLocal::ParseReachabilities( idLexer &src, int areaNum )
{
    int num, j;
    aasArea_t *area;
    idReachability reach, *newReach;
    idReachability_Special *special;

    area = &areas[areaNum];

    num = src.ParseInt();
    src.ExpectTokenString( "{" );
    area->reach = NULL;
    area->rev_reach = NULL;
    area->travelFlags = AreaContentsTravelFlags( areaNum );
    for ( j = 0; j < num; j++ )
    {
        Reachability_Read( src, &reach );
        switch( reach.travelType )
        {
        case TFL_SPECIAL:
            newReach = special = new idReachability_Special();
            Reachability_Special_Read( src, special );
            break;
        default:
            newReach = new idReachability();
            break;
        }
        newReach->CopyBase( reach );
        newReach->fromAreaNum = areaNum;
        newReach->next = area->reach;
        area->reach = newReach;
    }
    src.ExpectTokenString( "}" );
    return true;
}
开发者ID:revelator,项目名称:Revelator-Doom3,代码行数:40,代码来源:AASFile.cpp


示例3: ParseFloat

/*
============
idAASSettings::ParseFloat
============
*/
bool idAASSettings::ParseFloat( idLexer &src, float &f ) {
	if ( !src.ExpectTokenString( "=" ) ) {
		return false;
	}
	f = src.ParseFloat();
	return true;
}
开发者ID:MSylvia,项目名称:iod3,代码行数:12,代码来源:AASFile.cpp


示例4: ParseClusters

/*
================
idAASFileLocal::ParseClusters
================
*/
bool idAASFileLocal::ParseClusters( idLexer &src )
{
    int numClusters, i;
    aasCluster_t cluster;

    numClusters = src.ParseInt();
    clusters.Resize( numClusters );
    if ( !src.ExpectTokenString( "{" ) )
    {
        return false;
    }
    for ( i = 0; i < numClusters; i++ )
    {
        src.ParseInt();
        src.ExpectTokenString( "(" );
        cluster.numAreas = src.ParseInt();
        cluster.numReachableAreas = src.ParseInt();
        cluster.firstPortal = src.ParseInt();
        cluster.numPortals = src.ParseInt();
        src.ExpectTokenString( ")" );
        clusters.Append( cluster );
    }
    if ( !src.ExpectTokenString( "}" ) )
    {
        return false;
    }
    return true;
}
开发者ID:revelator,项目名称:Revelator-Doom3,代码行数:33,代码来源:AASFile.cpp


示例5: ParseBool

/*
============
idAASSettings::ParseBool
============
*/
bool idAASSettings::ParseBool( idLexer &src, bool &b ) {
	if ( !src.ExpectTokenString( "=" ) ) {
		return false;
	}
	b = src.ParseBool();
	return true;
}
开发者ID:MSylvia,项目名称:iod3,代码行数:12,代码来源:AASFile.cpp


示例6: ParseInt

/*
============
idAASSettings::ParseInt
============
*/
bool idAASSettings::ParseInt( idLexer &src, int &i ) {
	if ( !src.ExpectTokenString( "=" ) ) {
		return false;
	}
	i = src.ParseInt();
	return true;
}
开发者ID:MSylvia,项目名称:iod3,代码行数:12,代码来源:AASFile.cpp


示例7: ParseVertices

/*
================
idAASFileLocal::ParseVertices
================
*/
bool idAASFileLocal::ParseVertices( idLexer &src )
{
    int numVertices, i;
    idVec3 vec;

    numVertices = src.ParseInt();
    vertices.Resize( numVertices );
    if ( !src.ExpectTokenString( "{" ) )
    {
        return false;
    }
    for ( i = 0; i < numVertices; i++ )
    {
        src.ParseInt();
        if ( !src.Parse1DMatrix( 3, vec.ToFloatPtr() ) )
        {
            return false;
        }
        vertices.Append( vec );
    }
    if ( !src.ExpectTokenString( "}" ) )
    {
        return false;
    }
    return true;
}
开发者ID:revelator,项目名称:Revelator-Doom3,代码行数:31,代码来源:AASFile.cpp


示例8:

/*
====================
idRenderModelMD5::ParseJoint
====================
*/
void idRenderModelMD5::ParseJoint( idLexer& parser, idMD5Joint* joint, idJointQuat* defaultPose )
{
	//
	// parse name
	//
	idToken	token;
	parser.ReadToken( &token );
	joint->name = token;
	
	//
	// parse parent
	//
	int num = parser.ParseInt();
	if( num < 0 )
	{
		joint->parent = NULL;
	}
	else
	{
		if( num >= joints.Num() - 1 )
		{
			parser.Error( "Invalid parent for joint '%s'", joint->name.c_str() );
		}
		joint->parent = &joints[ num ];
	}
	
	//
	// parse default pose
	//
	parser.Parse1DMatrix( 3, defaultPose->t.ToFloatPtr() );
	parser.Parse1DMatrix( 3, defaultPose->q.ToFloatPtr() );
	defaultPose->q.w = defaultPose->q.CalcW();
}
开发者ID:BielBdeLuna,项目名称:StormEngine2,代码行数:38,代码来源:Model_md5.cpp


示例9: ParseVector

/*
============
idAASSettings::ParseVector
============
*/
bool idAASSettings::ParseVector( idLexer &src, idVec3 &vec )
{
    if ( !src.ExpectTokenString( "=" ) )
    {
        return false;
    }
    return ( src.Parse1DMatrix( 3, vec.ToFloatPtr() ) != 0 );
}
开发者ID:revelator,项目名称:Revelator-Doom3,代码行数:13,代码来源:AASFile.cpp


示例10: ParsePortals

/*
================
idAASFileLocal::ParsePortals
================
*/
bool idAASFileLocal::ParsePortals( idLexer &src )
{
    int numPortals, i;
    aasPortal_t portal;

    numPortals = src.ParseInt();
    portals.Resize( numPortals );
    if ( !src.ExpectTokenString( "{" ) )
    {
        return false;
    }
    for ( i = 0; i < numPortals; i++ )
    {
        src.ParseInt();
        src.ExpectTokenString( "(" );
        portal.areaNum = src.ParseInt();
        portal.clusters[0] = src.ParseInt();
        portal.clusters[1] = src.ParseInt();
        portal.clusterAreaNum[0] = src.ParseInt();
        portal.clusterAreaNum[1] = src.ParseInt();
        src.ExpectTokenString( ")" );
        portals.Append( portal );
    }
    if ( !src.ExpectTokenString( "}" ) )
    {
        return false;
    }
    return true;
}
开发者ID:revelator,项目名称:Revelator-Doom3,代码行数:34,代码来源:AASFile.cpp


示例11: Reachability_Special_Read

/*
================
Reachability_Special_Read
================
*/
bool Reachability_Special_Read( idLexer &src, idReachability_Special *reach ) {
	idToken key, value;

	src.ExpectTokenString( "{" );
	while( src.ReadToken( &key ) ) {
		if ( key == "}" ) {
			return true;
		}
		src.ExpectTokenType( TT_STRING, 0, &value );
		reach->dict.Set( key, value );
	}
	return false;
}
开发者ID:MSylvia,项目名称:iod3,代码行数:18,代码来源:AASFile.cpp


示例12: ParseNodes

/*
================
idAASFileLocal::ParseNodes
================
*/
bool idAASFileLocal::ParseNodes( idLexer &src )
{
    int numNodes, i;
    aasNode_t node;

    numNodes = src.ParseInt();
    nodes.Resize( numNodes );
    if ( !src.ExpectTokenString( "{" ) )
    {
        return false;
    }
    for ( i = 0; i < numNodes; i++ )
    {
        src.ParseInt();
        src.ExpectTokenString( "(" );
        node.planeNum = src.ParseInt();
        node.children[0] = src.ParseInt();
        node.children[1] = src.ParseInt();
        src.ExpectTokenString( ")" );
        nodes.Append( node );
    }
    if ( !src.ExpectTokenString( "}" ) )
    {
        return false;
    }
    return true;
}
开发者ID:revelator,项目名称:Revelator-Doom3,代码行数:32,代码来源:AASFile.cpp


示例13: ParseContents

/*
================
idDeclAF::ParseContents
================
*/
bool idDeclAF::ParseContents( idLexer &src, int &c ) const {
	idToken token;
	idStr str;

	while( src.ReadToken( &token ) ) {
		str += token;
		if ( !src.CheckTokenString( "," ) ) {
			break;
		}
		str += ",";
	}
	c = ContentsFromString( str );
	return true;
}
开发者ID:anonreclaimer,项目名称:morpheus,代码行数:19,代码来源:DeclAF.cpp


示例14: ParseInOutStruct

/*
========================
ParseInOutStruct
========================
*/
void ParseInOutStruct( idLexer & src, int attribType, idList< inOutVariable_t > & inOutVars ) {
	src.ExpectTokenString( "{" );

	while( !src.CheckTokenString( "}" ) ) {
		inOutVariable_t var;

		idToken token;
		src.ReadToken( &token );
		var.type = token;
		src.ReadToken( &token );
		var.nameCg = token;

		if ( !src.CheckTokenString( ":" ) ) {
			src.SkipUntilString( ";" );
			continue;
		}

		src.ReadToken( &token );
		var.nameGLSL = token;
		src.ExpectTokenString( ";" );

		// convert the type
		for ( int i = 0; typeConversion[i].typeCG != NULL; i++ ) {
			if ( var.type.Cmp( typeConversion[i].typeCG ) == 0 ) {
				var.type = typeConversion[i].typeGLSL;
				break;
			}
		}

		// convert the semantic to a GLSL name
		for ( int i = 0; attribsPC[i].semantic != NULL; i++ ) {
			if ( ( attribsPC[i].flags & attribType ) != 0 ) {
				if ( var.nameGLSL.Cmp( attribsPC[i].semantic ) == 0 ) {
					var.nameGLSL = attribsPC[i].glsl;
					break;
				}
			}
		}

		// check if it was defined previously
		var.declareInOut = true;
		for ( int i = 0; i < inOutVars.Num(); i++ ) {
			if ( var.nameGLSL == inOutVars[i].nameGLSL ) {
				var.declareInOut = false;
				break;
			}
		}

		inOutVars.Append( var );
	}

	src.ExpectTokenString( ";" );
}
开发者ID:MWisBest,项目名称:idTech4Prime,代码行数:58,代码来源:RenderProgs_GLSL.cpp


示例15: MatchAndAppendToken

/*
===================
MatchAndAppendToken
===================
*/
static void MatchAndAppendToken( idLexer &src, const char *match ) {
	if ( !src.ExpectTokenString( match ) ) {
		return;
	}
	// a matched token won't need a leading space
	idStr::Append( parseBuffer, MAX_IMAGE_NAME, match );
}
开发者ID:Justasic,项目名称:DOOM-3,代码行数:12,代码来源:Image_program.cpp


示例16: ParseIndex

/*
================
idAASFileLocal::ParseIndex
================
*/
bool idAASFileLocal::ParseIndex( idLexer &src, idList<aasIndex_t> &indexes )
{
    int numIndexes, i;
    aasIndex_t index;

    numIndexes = src.ParseInt();
    indexes.Resize( numIndexes );
    if ( !src.ExpectTokenString( "{" ) )
    {
        return false;
    }
    for ( i = 0; i < numIndexes; i++ )
    {
        src.ParseInt();
        src.ExpectTokenString( "(" );
        index = src.ParseInt();
        src.ExpectTokenString( ")" );
        indexes.Append( index );
    }
    if ( !src.ExpectTokenString( "}" ) )
    {
        return false;
    }
    return true;
}
开发者ID:revelator,项目名称:Revelator-Doom3,代码行数:30,代码来源:AASFile.cpp


示例17: ParseEdges

/*
================
idAASFileLocal::ParseEdges
================
*/
bool idAASFileLocal::ParseEdges( idLexer &src )
{
    int numEdges, i;
    aasEdge_t edge;

    numEdges = src.ParseInt();
    edges.Resize( numEdges );
    if ( !src.ExpectTokenString( "{" ) )
    {
        return false;
    }
    for ( i = 0; i < numEdges; i++ )
    {
        src.ParseInt();
        src.ExpectTokenString( "(" );
        edge.vertexNum[0] = src.ParseInt();
        edge.vertexNum[1] = src.ParseInt();
        src.ExpectTokenString( ")" );
        edges.Append( edge );
    }
    if ( !src.ExpectTokenString( "}" ) )
    {
        return false;
    }
    return true;
}
开发者ID:revelator,项目名称:Revelator-Doom3,代码行数:31,代码来源:AASFile.cpp


示例18: ParseParms

/*
================
idDeclParticle::ParseParms

Parses a variable length list of parms on one line
================
*/
void idDeclParticle::ParseParms( idLexer &src, float *parms, int maxParms ) {
	idToken token;

	memset( parms, 0, maxParms * sizeof( *parms ) );
	int	count = 0;
	while( 1 ) {
		if ( !src.ReadTokenOnLine( &token ) ) {
			return;
		}
		if ( count == maxParms ) {
			src.Error( "too many parms on line" );
			return;
		}
		token.StripQuotes();
		parms[count] = atof( token );
		count++;
	}
}
开发者ID:tankorsmash,项目名称:quadcow,代码行数:25,代码来源:DeclParticle.cpp


示例19: testAllToken

void testAllToken(idLexer& lexer)
{
    idToken token{};
    while (!lexer.EndOfToken()) {
        token.Reset();
        if (lexer.GetToken(&token)) {
            LOG(debug) << "token: " << token.AsTypeStringView() << "\t\t" << token.AsStringView();
        } else {
            LOG(warning) << "get token error line: " << lexer.Line();
            break;
        }
    }

    /*
    for (auto c : lexer.GetBuffer()) {
        std::cout << c;
    }
    std::cout << "\n";
    */
}
开发者ID:longshadian,项目名称:estl,代码行数:20,代码来源:Main.cpp


示例20: ParseSlider

/*
================
idDeclAF::ParseSlider
================
*/
bool idDeclAF::ParseSlider( idLexer& src )
{
	idToken token;
	idDeclAF_Constraint* constraint = new( TAG_DECL ) idDeclAF_Constraint;
	
	constraint->SetDefault( this );
	constraints.Alloc() = constraint;
	
	if( !src.ExpectTokenType( TT_STRING, 0, &token ) ||
			!src.ExpectTokenString( "{" ) )
	{
		return false;
	}
	
	constraint->type = DECLAF_CONSTRAINT_SLIDER;
	constraint->limit = idDeclAF_Constraint::LIMIT_NONE;
	constraint->name = token;
	constraint->friction = 0.5f;
	
	while( src.ReadToken( &token ) )
	{
	
		if( !token.Icmp( "body1" ) )
		{
			src.ExpectTokenType( TT_STRING, 0, &token );
			constraint->body1 = token;
		}
		else if( !token.Icmp( "body2" ) )
		{
			src.ExpectTokenType( TT_STRING, 0, &token );
			constraint->body2 = token;
		}
		else if( !token.Icmp( "axis" ) )
		{
			if( !constraint->axis.Parse( src ) )
			{
				return false;
			}
		}
		else if( !token.Icmp( "friction" ) )
		{
			constraint->friction = src.ParseFloat();
		}
		else if( token == "}" )
		{
			break;
		}
		else
		{
			src.Error( "unknown token %s in slider", token.c_str() );
			return false;
		}
	}
	
	return true;
}
开发者ID:dcahrakos,项目名称:RBDOOM-3-BFG,代码行数:61,代码来源:DeclAF.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ idLinkList类代码示例发布时间:2022-05-31
下一篇:
C++ idHierarchy类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap