Hot Search : Source embeded web remote control p2p game More...
Location : Home Search - INT 1
Search - INT 1 - List
ergydfhgdfhggfhg 一.实验目的 二.实验内容 三、程序简要说明 原 文 : C语言词法分析器的设计与实现 一.实验目的: 1.强化对系统软件综合工程实现能力、规划能力的训练; 2.加强对词法分析原理、方法和基本实现技术的理解; 二.实验内容: 用C语言(或 C++ )作为宿主语言完成: C语言(ANSI C或turbo C 2.0)词法分析器的设计和实现。 三、程序简要说明: 1、属性字说明: 共9种 KEYWORD: 关键字 \"auto\",\"break\",\"case\",\"char\",\"const\",\"continue\", \"default\",\"do\",\"double\",\"else\",\"enum\",\"extern\", \"float\",\"for\",\"goto\",\"if\",\"int\",\"long\",\"register\", \"return\",\"short\",\"signed\",\"sizeof\",\"static\",\"struct\", \"switch\",\"typedef\",\"union\",\"unsigned\",\"void\", \"volatile\",\"while\",\"include\",\"define\" 共34个 详见IsKeyWord()函数 NUMBER: 数字 包括十进制整数,八进制整数,二进制整数,十六进制整数 还可返回几种错误 详见IsNumber()函数 CONSTANT: 常量 宏定义标识符,不识别C++关键字const,简单处理一层宏定义。 详见IsDefined()函数 ...... 关键词 : 计算机 编译原理 c语言 词法分析器-ergydfhg gfhg one. Experiment 2. Experiment 3, procedures brief description of the original : C language lexical analyzer Design and Implementation of a. The experiment : 1. To strengthen the integrated system software engineering, planning capacity of training; 2. Lexical analysis on principle, and basic understanding of the technology; 2. Experiment : C (or C) as the host language completed : C language (ANSI C or Turbo C 2.0) lexical analyzer design and implementation. 3, brief description of procedures : 1, the word attribute : a total of nine species KEYWORD : keyword "auto" "break" and "case", "char", "const", "continue", "default", "do", "double", "else", "enum" "ext
Date : 2008-10-13 Size : 1.19kb User : 天空

public class Server extends Thread { Client client int counter public Server(Client _client) { this.client = _client this.counter = 0 } public void run() { while (counter < 10) { this.client.queue.addElement(new Integer(counter)) counter++ } throw new RuntimeException(\"counter >= 10\") } public static void main(String[] args) { Client c = new Client() Server s = new Server(c) c.start() s.start() } } class Client extends Thread { Vector queue public Client() { this.queue = new Vector() } public void run() { while (true) { if (! (queue.size() == 0)) { processNextElement() } } } private void processNextElement() { Object next = queue.elementAt(0) queue.removeElementAt(0) System.out.println(next)-public class Server extends Thread { Client client int counter public Server(Client _client) { this.client = _client this.counter = 0 } public void run() { while (counter lt; 10) { this.client.queue.addElement(new Integer(counter)) counter++ } throw new RuntimeException(\"counter gt;= 10\") } public static void main(String[] args) { Client c = new Client() Server s = new Server(c) c.start() s.start() } } class Client extends Thread { Vector queue public Client() { this.queue = new Vector() } public void run() { while (true) { if (! (queue.size() == 0)) { processNextElement() } } } private void processNextElement() { Obje
Date : 2008-10-13 Size : 1.08kb User : 阿乌鸟

ergydfhgdfhggfhg 一.实验目的 二.实验内容 三、程序简要说明 原 文 : C语言词法分析器的设计与实现 一.实验目的: 1.强化对系统软件综合工程实现能力、规划能力的训练; 2.加强对词法分析原理、方法和基本实现技术的理解; 二.实验内容: 用C语言(或 C++ )作为宿主语言完成: C语言(ANSI C或turbo C 2.0)词法分析器的设计和实现。 三、程序简要说明: 1、属性字说明: 共9种 KEYWORD: 关键字 "auto","break","case","char","const","continue", "default","do","double","else","enum","extern", "float","for","goto","if","int","long","register", "return","short","signed","sizeof","static","struct", "switch","typedef","union","unsigned","void", "volatile","while","include","define" 共34个 详见IsKeyWord()函数 NUMBER: 数字 包括十进制整数,八进制整数,二进制整数,十六进制整数 还可返回几种错误 详见IsNumber()函数 CONSTANT: 常量 宏定义标识符,不识别C++关键字const,简单处理一层宏定义。 详见IsDefined()函数 ...... 关键词 : 计算机 编译原理 c语言 词法分析器-ergydfhg gfhg one. Experiment 2. Experiment 3, procedures brief description of the original : C language lexical analyzer Design and Implementation of a. The experiment : 1. To strengthen the integrated system software engineering, planning capacity of training; 2. Lexical analysis on principle, and basic understanding of the technology; 2. Experiment : C (or C) as the host language completed : C language (ANSI C or Turbo C 2.0) lexical analyzer design and implementation. 3, brief description of procedures : 1, the word attribute : a total of nine species KEYWORD : keyword "auto" "break" and "case", "char", "const", "continue", "default", "do", "double", "else", "enum" "ext
Date : 2026-01-09 Size : 1kb User : 天空

编写顺序查找的方法public static int[] ordinalSearch(int data[],int key),要求该方法返回一个数组(如果key存在,数组中各元素的值分别为关键字key在原数组data中的下标;如果key不存在,则返回一个长度为1的数组,数组元素为-1)。-Write a sequential search method public static int [] ordinalSearch (int data [], int key) This method returns an array (if the key exists, the value of each element in the array subscript in the original array data for the keyword key if the key does not exist, it returns a length for an array of elements to-1).
Date : 2026-01-09 Size : 1kb User : 付童男

编写一个方法,输出在一个字符串中,指定字符串出现的次数.方法原型为: public static int countStr(String str1,string str2) -package defalt public class Hellow { public static void main(String args[]) {String str1="Hello,it is Tom speaking,who is that?" String str2="is" System.out.println(countStr(str1,str2)) } public static int countStr(String str1,String str2){ int num=0 int indexFrom=0 indexFrom=str1.indexOf(str2,indexFrom) while(indexFrom!=-1){ num++ indexFrom+=str2.length() indexFrom=str1.indexOf(str2,indexFrom) } return num } }
Date : 2026-01-09 Size : 4kb User :
CodeBus is one of the largest source code repositories on the Internet!
Contact us :
1999-2046 CodeBus All Rights Reserved.