Livejournal
Log in
Post
Friends
My journal
emer
(Untitled)
Apr 14, 2004 16:30
Think you know everything about me? Take the "How Well Do You Know Emer?" quiz I created on Tickle and see how you score (
Read more...
)
Leave a comment
Back to all threads
I go an extension!
emer
May 21 2004, 16:12:36 UTC
here is the rest of the code....
while (token !=EOF)
if (token == ADD)
{
Addition();
}
if (token == SUB)
{
Subtraction();
}
if (token == DIV)
{
Divide();
}
if (token == MUL)
{
Multiply();
}
void Addition(void)
{
accumlator=accumlator + temp2;
get_next_token();
if (strcmp(token,"ADR")==0)
Variable();
if (strcmp(token,"LIT")==0)
Literal();
if(strcmp(token,"STORE")== 0)
Store();
}
void Subtraction(void)
{
accumlator= accumlator - temp2;
get_next_token();
if (strcmp(token,"ADR")==0)
Variable();
if (strcmp(token,"LIT")==0)
Literal();
if(strcmp(token, "STORE")== 0)
Store();
}
void Multiply(void)
{
accumlator= accumlator * temp2;
get_next_token();
if (strcmp(token,"ADR")==0)
//if(token == ADR)
Variable();
if (strcmp(token,"LIT")==0)
//if(token == LIT)
Literal();
if (strcmp(token,"STORE")==0)
//if(token == STORE)
Store();
}
void Divide(void)
{
accumlator = accumlator / temp2;
get_next_token();
if (strcmp(token,"ADR")==0)
//if(token == ADR)
Variable();
if (strcmp(token,"LIT")==0)
//if(token == LIT)
Literal();
if (strcmp(token,"STORE")==0)
//if(token == STORE)
Store();
}
void Store(void)
{
for (i=0; i<10; i++)
{
if(code_keys [i] [0] == flag_var)
(code_keys [i] [1] == accumlator);
}
get_next_token();
position = 0;
}
void string_test(void)
{
Cut_Sub_String[3]= NULL;
Cut_String_Remainder[3]= NULL;
int Sub_String_Position = 0;
int count_position=0;
int String_remainder_pos=0;
int t=0;
int j=0;
t=0;
j=0;
Sub_String_Position=0;
count_position=0;
String_remainder_pos=0;
Cut_Sub_String[0]=NULL;
Cut_String_Remainder[0]=NULL;
token_code;
token_value;
strcpy(Primary_String,token);
for (t=0; t<7; t++)
{
if(strncmp (token, code_keys[t], 3)==0) // are the first three chars of the
token equal to the code [t]
{
strcpy(Sub_String, code_keys[t]);
}
}
String_size=strlen(Primary_String);
for (j=0; j
Reply
Back to all threads
Leave a comment
Up
while (token !=EOF)
if (token == ADD)
{
Addition();
}
if (token == SUB)
{
Subtraction();
}
if (token == DIV)
{
Divide();
}
if (token == MUL)
{
Multiply();
}
void Addition(void)
{
accumlator=accumlator + temp2;
get_next_token();
if (strcmp(token,"ADR")==0)
Variable();
if (strcmp(token,"LIT")==0)
Literal();
if(strcmp(token,"STORE")== 0)
Store();
}
void Subtraction(void)
{
accumlator= accumlator - temp2;
get_next_token();
if (strcmp(token,"ADR")==0)
Variable();
if (strcmp(token,"LIT")==0)
Literal();
if(strcmp(token, "STORE")== 0)
Store();
}
void Multiply(void)
{
accumlator= accumlator * temp2;
get_next_token();
if (strcmp(token,"ADR")==0)
//if(token == ADR)
Variable();
if (strcmp(token,"LIT")==0)
//if(token == LIT)
Literal();
if (strcmp(token,"STORE")==0)
//if(token == STORE)
Store();
}
void Divide(void)
{
accumlator = accumlator / temp2;
get_next_token();
if (strcmp(token,"ADR")==0)
//if(token == ADR)
Variable();
if (strcmp(token,"LIT")==0)
//if(token == LIT)
Literal();
if (strcmp(token,"STORE")==0)
//if(token == STORE)
Store();
}
void Store(void)
{
for (i=0; i<10; i++)
{
if(code_keys [i] [0] == flag_var)
(code_keys [i] [1] == accumlator);
}
get_next_token();
position = 0;
}
void string_test(void)
{
Cut_Sub_String[3]= NULL;
Cut_String_Remainder[3]= NULL;
int Sub_String_Position = 0;
int count_position=0;
int String_remainder_pos=0;
int t=0;
int j=0;
t=0;
j=0;
Sub_String_Position=0;
count_position=0;
String_remainder_pos=0;
Cut_Sub_String[0]=NULL;
Cut_String_Remainder[0]=NULL;
token_code;
token_value;
strcpy(Primary_String,token);
for (t=0; t<7; t++)
{
if(strncmp (token, code_keys[t], 3)==0) // are the first three chars of the
token equal to the code [t]
{
strcpy(Sub_String, code_keys[t]);
}
}
String_size=strlen(Primary_String);
for (j=0; j
Reply
Leave a comment