//---------------------------------------------------------------------------

#include "stdafx.h"

using namespace std;

#ifdef _MSC_VER
#pragma hdrstop
#endif

#include "utils.h"

//---------------------------------------------------------------------------

// PLA Parser

string GetToken( const char *line, unsigned int &pos )
{
    string s;

    while ( line[pos] == ' ' || line[pos] == '|' || line[pos] == 10 || line[pos] == 9 || line[pos] == 13 ) pos++;
    while ( line[pos] != ' ' && line[pos] != '|' && line[pos] != 0 && line[pos] != 10 && line[pos] != 9 && line[pos] != 13 )
        s+=line[pos++];
    return s;
}

string GetExtension( const string &s )
// returns the filename extension
{
	string res;
	unsigned int i;

	i = s.find_last_of( "." );
	res = s.substr(i+1, s.length() );
	return res;
}
