Updated LParser.cpp 9-16-15
This commit is contained in:
parent
091ac01645
commit
f755bbc42a
1 changed files with 49 additions and 1 deletions
50
LParser.cpp
50
LParser.cpp
|
@ -1,2 +1,50 @@
|
||||||
// Lexical Parser
|
// Lexical Parser
|
||||||
// Test file
|
// Test file
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include "DBEngine.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int digit(char c)
|
||||||
|
{
|
||||||
|
if(isdigit(c))
|
||||||
|
{
|
||||||
|
return atoi(c);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
char alpha(char c)
|
||||||
|
{
|
||||||
|
toupper(c);
|
||||||
|
string a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
|
int x = 0;
|
||||||
|
while(x != a.length())
|
||||||
|
{
|
||||||
|
if(c == a[x])
|
||||||
|
{
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
x++;
|
||||||
|
}
|
||||||
|
return "?";
|
||||||
|
}
|
||||||
|
|
||||||
|
char space(char c)
|
||||||
|
{
|
||||||
|
if(c == " ")
|
||||||
|
{
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
return "?";
|
||||||
|
}
|
||||||
|
|
||||||
|
char arnold(char c)
|
||||||
|
{
|
||||||
|
if(c == ";")
|
||||||
|
{
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
return "?";
|
||||||
|
}
|
Reference in a new issue