原创 語法分析器(syntax analyzer)【C實現】

查看正文內容 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #include <stdbool.h> #include

原创 編譯器之詞法分析器(Lexical Analyzer)

定義 (來自維基百科) 詞法分析(英語:lexical analysis)是計算機科學中將字符序列轉換爲標記(token)序列的過程。進行詞法分析的程序或者函數叫作詞法分析器(lexical analyzer,簡稱lexer),也

原创 詞法分析器(Lexical Analyzer)【C實現】

查看正文內容 #include <stdlib.h> #include <stdio.h> #include <stdarg.h> #include <ctype.h> #include <string.h> #include <

原创 哲學家用餐問題(Dining philosophers)【代碼實現】

C #include <pthread.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <stdarg.h> #define N 5

原创 多語言實現電子郵件發送功能

C #include <curl/curl.h> #include <string.h> #include <stdio.h> #define from "<[email protected]>" #define to

原创 CRC-32【代碼實現】

C #include <inttypes.h> #include <stdio.h> #include <string.h> uint32_t rc_crc32(uint32_t crc, const char *buf, s

原创 編譯器之語法分析器(syntax analyzer)

語法分析器根據語法將標記流(來自詞法分析器)轉換爲語法樹。 目標 從“詞法分析器” 任務中獲取輸出,並根據以下語法將其轉換爲抽象語法樹(AST)。輸出應爲展平格式。 程序應從文件和/或stdin讀取輸入,並將輸出寫入文件和/或st

原创 計算機技術與軟件專業技術資格(水平)考試指南

專業類別、資格名稱和級別層次對應表 計算機技術與軟件專業技術資格(水平)考試 專業類別、資格名稱和級別層次對應表 計算機軟件 計算機網絡 計算機應用技術 信息系統 信息服務 高級資格 「信息系統

原创 語法分析器(syntax analyzer)【Go實現】

查看正文內容 package main import ( "bufio" "fmt" "log" "os" "strconv" "strings" ) type TokenT

原创 詞法分析器(Lexical Analyzer)【JavaScript實現】

查看正文內容 /* Token: type, value, line, pos */ const TokenType = { Keyword_if: 1, Keyword_else: 2, Keyword_pr

原创 詞法分析器(Lexical Analyzer)【C#實現】

查看正文內容 using System; using System.IO; using System.Linq; using System.Collections.Generic; namespace Rosetta {

原创 詞法分析器(Lexical Analyzer)【Go實現】

查看正文內容 package main import ( "bufio" "fmt" "log" "os" ) type TokenType int const ( tkEOI

原创 語法分析器(syntax analyzer)【Java實現】

查看正文內容 import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; import java.util.String

原创 語法分析器(syntax analyzer)【Python實現】

查看正文內容 from __future__ import print_function import sys, shlex, operator tk_EOI, tk_Mul, tk_Div, tk_Mod, tk_Add,

原创 並行計算(Parallel calculations)【代碼實現】

假設有一組數字,我們希望找到最大的最小素因數。爲了加快搜索速度,因式分解應該使用單獨的線程或進程並行執行,以充分利用CPU的多個核。 C 使用gcc -Wall -std=c99 -fopenmp編譯,其中需要gcc 4.2或更高