❶ 一個更新sql語句說is_syn找不到在pl/sql中怎麼改啊,急!!
select * from demand_task_table where is_syn='' ;運行,出錯證明demand_task_table 裡面is_syn沒有這個欄位
select d.is_syn from demand_detail d where d.id=1236;運行,出錯證明demand_detail 裡面is_syn沒有這個欄位
❷ 編譯原理語法分析實驗問題
錯誤1:在3.txt中,第二個表達式x:=2*3,在編譯器裡面沒有對*符號進行解釋,這個應補充,或者改掉*為+。
錯誤2:代碼中出現3次類似syn==15||16的代碼,我理解應該是(syn==15)||(syn==16)
改掉這兩點後代碼可以正常運行。
建議:寫代碼是一項工作,更是一個創作過程,建議你按照代碼寫作規范來寫,這樣的代碼清晰易讀,易於交流和糾錯。
❸ 編譯原理實驗「C語言」檢查某段C源程序中,標識符的使用是否正確,即是否先聲明後使用,或
#include "stdio.h" /*定義I/O庫所用的某些宏和變數*/
#include "string.h" /*定義字元串庫函數*/
#include "conio.h" /*提供有關屏幕窗口操作函數*/
#include "ctype.h" /*分類函數*/
char prog[80]=,
token[8]; /*存放構成單詞符號的字元串*/
char ch;
int syn, /*存放單詞字元的種別碼*/
n,
sum, /*存放整數型單詞*/
m,p; /*p是緩沖區prog的指針,m是token的指針*/
char *rwtab[6]=;
void scaner(){
m=0;
sum=0;
for(n=0;n<8;n++)
token[n]='\0';
ch=prog[p++];
while(ch==' ')
ch=prog[p++];
if(isalpha(ch)) /*ch為字母字元*/{
while(isalpha(ch)||isdigit(ch)) /*ch 為字母字元或者數字字元*/{
token[m++]=ch;
ch=prog[p++];}
token[m++]='\0';
ch=prog[p--];
syn=10;
for(n=0;n<6;n++)
if(strcmp(token,rwtab[n])==0) /*字元串的比較*/{
syn=n+1;
break;}}
else
if(isdigit(ch)) /*ch是數字字元*/{
while(isdigit(ch)) /*ch是數字字元*/{
sum=sum*10+ch-'0';
ch=prog[p++];}
ch=prog[p--];
syn=11;}
else
switch(ch){
case'<':m=0;token[m++]=ch;ch=prog[p++];
if(ch=='>'){
syn=21;
token[m++]=ch;}
else if(ch=='='){
syn=22;
token[m++]=ch;}
else{
syn=20;
ch=prog[p--];}
break;
case'>':m=0;token[m++]=ch;ch=prog[p++];
if(ch=='='){
syn=24;
token[m++]=ch;}
else{
syn=23;
ch=prog[p--];}
break;
case':':m=0;token[m++]=ch;ch=prog[p++];
if(ch=='='){
syn=18;
token[m++]=ch;}
else{
syn=17;
ch=prog[p--];}
break;
case'+':syn=13;token[0]=ch;break;
case'-':syn=14;token[0]=ch;break;
case'*':syn=15;token[0]=ch;break;
case'/':syn=16;token[0]=ch;break;
case'=':syn=25;token[0]=ch;break;
case';':syn=26;token[0]=ch;break;
case'(':syn=27;token[0]=ch;break;
case')':syn=28;token[0]=ch;break;
case'#':syn=0;token[0]=ch;break;
default:syn=-1;}}
main()
{
printf("\n\nThe significance of the figures:\n"
"1.figures 1 to 6 said Keyword\n"
"2.figures 10 and 11 said Other indicators\n"
"3.figures 13 to 28 said Operators\n");
p=0;
printf("\nplease input string:\n");
do {
ch=getchar();
prog[p++]=ch;
}while(ch!='#');
p=0;
do{
scaner();
switch(syn){
case 11: printf("(%d,%d)\n",syn,sum);break;
case -1: printf("\n ERROR;\n");break;
default: printf("(%d,%s)\n",syn,token);
}
}while(syn!=0);
getch();
}
程序測試結果
對源程序begin x:=9: if x>9 then x:=2*x+1/3; end #的源文件,經過詞法分析後輸出如下圖5-1所示:
具體的你在修改修改吧
❹ 編譯原理課程設計-詞法分析器設計(C語言)
#include"stdio.h"/*定義I/O庫所用的某些宏和變數*/
#include"string.h"/*定義字元串庫函數*/
#include"conio.h"/*提供有關屏幕窗口操作函數*/
#include"ctype.h"/*分類函數*/
charprog[80]={'