Exemplo n.º 1
0
//A vector of indice vectors.
//Each indice vector is a list of index references which together reference a single line of plaintext
static std::vector<std::vector<int>> into_plaintext_indices(TokenString& tokenstring) {
	std::vector<std::vector<int>> indices = { {} };
	int line = 0;
	for (unsigned int i = 0; i < tokenstring.tokens.size(); ++i) {
		PrintToken* next = &tokenstring.tokens[i];

		if (tokenIsType(*next,PrintTokenType::NEWLINE)) {
			++line;
			indices.push_back({});
		}

		if (tokenIsType(*next,PrintTokenType::TEXT)) {
			indices[line].push_back(i);
		}
	}

	return indices;
}
Exemplo n.º 2
0
static void parseMethod (tokenInfo *token, int owner)
{
	tokenRead (token);
	if (tokenIsType (token, TCL_IDENTIFIER))
	{
		tagEntryInfo e;

		initTagEntry(&e, vStringValue (token->string), K_METHOD);
		e.extensionFields.scopeIndex = owner;
		makeTagEntry (&e);
	}
	skipToEndOfTclCmdline (token);
}
Exemplo n.º 3
0
static void parseSuperclass (tokenInfo *token, int this_class)
{
	tokenRead (token);
	if (tokenIsType (token, TCL_IDENTIFIER))
	{
		tagEntryInfo *e = getEntryInCorkQueue(this_class);

		if (e)
		{
			if (e->extensionFields.inheritance)
			{   /* superclass is used twice in a class. */
				eFree ((void *)e->extensionFields.inheritance);
			}
			e->extensionFields.inheritance = eStrdup(tokenString(token));
		}
	}
	skipToEndOfTclCmdline (token);
}
Exemplo n.º 4
0
bool tokenIsKeyword  (tokenInfo *token, tokenKeyword k)
{
	return (tokenIsType (token, token->klass->typeForKeyword)
			&& token->keyword == k)? true: false;
}