日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

lua# lua5.1.4 源码文件作用一览

發布時間:2023/12/2 编程问答 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 lua# lua5.1.4 源码文件作用一览 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

寫了個腳本列出lua源碼C文件頭部的注釋,作為我有一搭沒一搭以Lua為對象學習編譯原理的開端。

lua5.1.4全部的源碼有35個C文件,17216行代碼。每個文件基本的功能如下

./output_lua_sources_comments.sh ~/resources/sources/lua/src????????????????????????????????????????????????????????????????????????????????? myarch/others (master ?) mattPC
???? 1?? ?52??? lctype.c?????? 'ctype' functions for Lua
???? 2?? ?67??? linit.c??????? Initialization of libraries for lua.c and other clients
???? 3?? ?76??? lzio.c???????? Buffered streams
???? 4?? ?77??? ltm.c????????? Tag methods
???? 5?? ?99??? lmem.c???????? Interface to Memory Manager
???? 6?? ?107?? lopcodes.c???? Opcodes for Lua virtual machine
???? 7?? ?155?? lcorolib.c???? Coroutine Library
???? 8?? ?161?? lfunc.c??????? Auxiliary functions to manipulate prototypes and closures
???? 9?? ?173?? ldump.c??????? save precompiled Lua chunks
??? 10?? ?185?? lstring.c????? String table (keeps all strings handled by Lua)
??? 11?? ?209?? lbitlib.c????? Standard library for bitwise operations
??? 12?? ?258?? lundump.c????? load precompiled Lua chunks
??? 13?? ?283?? lmathlib.c???? Standard mathematical library
??? 14?? ?283?? ltablib.c????? Library for Table Manipulation
??? 15?? ?289?? lobject.c????? Some generic functions over Lua objects
??? 16?? ?322?? lstate.c?????? Global State
??? 17?? ?323?? loslib.c?????? Standard Operating System library
??? 18?? ?398?? ldblib.c?????? Interface from Lua to its debug API
??? 19?? ?432?? luac.c???????? Lua compiler (saves bytecodes to files; also list bytecodes)
??? 20?? ?459?? lbaselib.c???? Basic library
??? 21?? ?496?? lua.c????????? Lua stand-alone interpreter
??? 22?? ?527?? llex.c???????? Lexical Analyzer
??? 23?? ?580?? ldebug.c?????? Debug Interface
??? 24?? ?588?? ltable.c?????? Lua tables (hash)
??? 25?? ?657?? liolib.c?????? Standard I/O (and system) library
??? 26?? ?668?? ldo.c????????? Stack and Call structure of Lua
??? 27?? ?725?? loadlib.c????? Dynamic library loader for Lua
??? 28?? ?766?? loadlib_rel.c? Dynamic library loader for Lua
??? 29?? ?868?? lvm.c????????? Lua virtual machine
??? 30?? ?882?? lcode.c??????? Code generator for Lua
??? 31?? ?958?? lauxlib.c????? Auxiliary functions for building Lua libraries
??? 32?? ?972?? lstrlib.c????? Standard library for string operations and pattern-matching
??? 33?? ?1205? lgc.c????????? Garbage Collector
??? 34?? ?1281? lapi.c???????? Lua API
??? 35?? ?1635? lparser.c????? Lua Parser
----------------------------------------------------------------------------------------
??????? 17216

以下是bash腳本,內容也算豐富。

1 [[ "$#" == 0 ]] && { 2 echo "usage: $0 path" 3 exit 1 4 } 5 6 src_dir="$1" 7 pos=$((${#src_dir}+2)) 8 9 outline () 10 { 11 printf "%-6d%-15s%s\n" "$1" "$2" "$3" 12 } 13 14 { 15 for file in `ls -1 "$src_dir""/*.c"` ; do 16 comment=`sed -n "3p" $file | cut -d" " -f2-` 17 filename=`basename $file` 18 lines=`wc -l $file | cut -d" " -f1` 19 outline "$lines" "$filename" "$comment" 20 done 21 } | sort -nk 1| cat -b | awk '{ if(l<length($0)){ l=length($0)}; s+=$2; print $0} 22 END { while(l--){ sp=sp"-"} print sp ;printf("%8s%-6d\n","",s)}'

?

?

?

?

轉載于:https://www.cnblogs.com/mattmonkey/archive/2012/12/08/2808502.html

總結

以上是生活随笔為你收集整理的lua# lua5.1.4 源码文件作用一览的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。