Beispiel #1
0
static void findFeatureEnd (tokenInfo *const token)
{
	boolean isFound = isKeyword (token, KEYWORD_is);
	if (isFound)
		readToken (token);
	switch (token->keyword)
	{
		case KEYWORD_attribute:
		case KEYWORD_deferred:
		case KEYWORD_do:
		case KEYWORD_external:
		case KEYWORD_local:
		case KEYWORD_note:
		case KEYWORD_obsolete:
		case KEYWORD_once:
		case KEYWORD_require:
		{
			int depth = 1;

			while (depth > 0 && ! isType (token, TOKEN_EOF))
			{
				switch (token->keyword)
				{
					case KEYWORD_check:
					case KEYWORD_debug:
					case KEYWORD_from:
					case KEYWORD_across:
					case KEYWORD_if:
					case KEYWORD_inspect:
						++depth;
						break;

					case KEYWORD_local:
						parseLocal (token);
						break;

					case KEYWORD_end:
						--depth;
						break;

					default:
						break;
				}
				readToken (token);
			}
			break;
		}

		default:
			/* is this a manifest constant? */
			if (isFound || isType (token, TOKEN_OPERATOR)) {
				if (isType (token, TOKEN_OPERATOR))
					readToken (token);
				readToken (token);
			}
			break;
	}
}
vector<vector<Local *> > parseLocais(vector<vector<string> > linhas) {
    vector<vector<Local *> > vecLinhas;
    vector<Local *> locais;

    /*  */
    for (unsigned linha = 0; linha < linhas.size(); linha++) {
        for (unsigned local = 0; local < linhas[linha].size(); local++) {
            locais.push_back(parseLocal(linhas[linha][local]));
        }
        vecLinhas.push_back(locais);
        locais.clear();
    }
    return vecLinhas;
}
Beispiel #3
0
static void findFeatureEnd (tokenInfo *const token)
{
    readToken (token);

    switch (token->keyword)
    {
    default:
        if (isType (token, TOKEN_OPERATOR)) /* sign of manifest constant */
            readToken (token);
        readToken (token);          /* skip to next token after constant */
        break;

    case KEYWORD_deferred:
    case KEYWORD_do:
    case KEYWORD_external:
    case KEYWORD_local:
    case KEYWORD_obsolete:
    case KEYWORD_once:
    case KEYWORD_require:
    {
        int depth = 1;

        while (depth > 0)
        {
#ifdef TYPE_REFERENCE_TOOL
            if (isType (token, TOKEN_OPEN_BRACE))
            {
                readToken (token);
                if (isType (token, TOKEN_IDENTIFIER))
                    parseType (token);
            }
            else if (isType (token, TOKEN_BANG))
            {
                readToken (token);
                if (isType (token, TOKEN_IDENTIFIER))
                    parseType (token);
                if (isType (token, TOKEN_BANG))
                    readToken (token);
            }
            else
#endif
                switch (token->keyword)
                {
                case KEYWORD_check:
                case KEYWORD_debug:
                case KEYWORD_from:
                case KEYWORD_if:
                case KEYWORD_inspect:
                    ++depth;
                    break;

                case KEYWORD_local:
                    parseLocal (token);
                    break;

                case KEYWORD_end:
                    --depth;
                    break;

                default:
                    break;
                }
            readToken (token);
        }
        break;
    }
    }
}
Beispiel #4
0
static void findFeatureEnd (tokenInfo *const token)
{
	boolean isFound = isKeyword (token, KEYWORD_is);
	if (isFound)
		readToken (token);
	switch (token->keyword)
	{
		case KEYWORD_deferred:
		case KEYWORD_do:
		case KEYWORD_external:
		case KEYWORD_local:
		case KEYWORD_obsolete:
		case KEYWORD_once:
		case KEYWORD_require:
		{
			int depth = 1;

			while (depth > 0 && ! isType (token, TOKEN_EOF))
			{
#ifdef TYPE_REFERENCE_TOOL
				if (isType (token, TOKEN_OPEN_BRACE))
				{
					readToken (token);
					if (isType (token, TOKEN_IDENTIFIER))
						parseType (token);
				}
				else if (isType (token, TOKEN_BANG))
				{
					readToken (token);
					if (isType (token, TOKEN_IDENTIFIER))
						parseType (token);
					if (isType (token, TOKEN_BANG))
						readToken (token);
				}
				else
#endif
				switch (token->keyword)
				{
					case KEYWORD_check:
					case KEYWORD_debug:
					case KEYWORD_from:
					case KEYWORD_if:
					case KEYWORD_inspect:
						++depth;
						break;

					case KEYWORD_local:
						parseLocal (token);
						break;

					case KEYWORD_end:
						--depth;
						break;

					default:
						break;
				}
				readToken (token);
			}
			break;
		}

		default:
			/* is this a manifest constant? */
			if (isFound || isType (token, TOKEN_OPERATOR)) {
				if (isType (token, TOKEN_OPERATOR))
					readToken (token);
				readToken (token);
			}
			break;
	}
}