本文整理汇总了C++中ASTType::getArrayType方法的典型用法代码示例。如果您正苦于以下问题:C++ ASTType::getArrayType方法的具体用法?C++ ASTType::getArrayType怎么用?C++ ASTType::getArrayType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ASTType
的用法示例。
在下文中一共展示了ASTType::getArrayType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: visit
//.........这里部分代码省略.........
{
case ASTType::eObject:
{
ASSERT(mCurrentType.hasObjectClass());
const ASTClass& type = mCurrentType.getObjectClass();
checkFunctionAccess(type, ast, wasstatic);
}
break;
case ASTType::eArray:
{
const ASTClass& arrayclass = mContext.resolveClass(UTEXT("system.InternalArray"));
checkFunctionAccess(arrayclass, ast, wasstatic);
}
break;
case ASTType::eString:
{
const ASTClass& stringclass = mContext.resolveClass(UTEXT("system.InternalString"));
checkFunctionAccess(stringclass, ast, wasstatic);
}
break;
case ASTType::eVoid:
{
error(E0039, UTEXT("Can not invoke a method on a void object."), ast);
}
break;
default:
{
error(E0040, UTEXT("Can not invoke method on basic types."), ast);
}
break;
}
}
else
{
checkFunctionAccess(*mpClass, ast, wasstatic);
}
}
break;
case ASTAccess::eArray:
{
if ( !mCurrentType.isArray() )
{
error(E0041, mCurrentType.toString() + UTEXT(" is not an array type."), ast);
}
else
{
ast.setAccess(ASTAccess::eArrayAccess);
ASTType before = mCurrentType;
ASTNodes& arguments = ast.getArguments();
for ( int index = 0; index < arguments.size(); index++ )
{
ASTExpression& expr = dynamic_cast<ASTExpression&>(arguments[index]);
expr.accept(*this);
if ( !mCurrentType.isInt() )
{
error(E0042, UTEXT("Array access expression must be of type int."), ast);
}
}
mCurrentType = before.getArrayType();
}
}
break;
case ASTAccess::eStatic:
mCurrentType = ast.getStaticType();
mStatic = true;
break;
case ASTAccess::eClass:
{
if ( !mCurrentType.isObject() )
{
warning(W0002, UTEXT("The class operator currently is only supported for objects."), ast);
}
if ( !wasstatic )
ast.setAccess(ASTAccess::eField);
else
ast.setAccess(ASTAccess::eRefField);
mCurrentType.clear();
mCurrentType.setKind(ASTType::eObject);
mCurrentType.setObjectName(UTEXT("system.Class"));
mCurrentType.setObjectClass(mContext.resolveClass(UTEXT("system.Class")));
}
break;
case ASTAccess::eInvalid:
default:
{
error(E0043, UTEXT("Unknown access detected."), ast);
}
break;
}
}