compile script improve.
[reglxgmr.git] / README.md
bloba3c11b762ac90d61ed930b282132cc50bd3a51ed
2 # inroduction
3 -------------
5     this srcpkg is an idea borned from build-config, which is a traditional
6 menuconfig program in buildroot(not in kernel). it recognize token by looking 
7 up defination in array.
8     read the doc in doc/designdoc/*, you will known how does this method 
9 comming.
11     reglxgmr is the short name combination of regex, lxr, and gmr.
12     it analyze tokens differet from lxr program(flex), it spilt text in those
13 kinds:
15 @ mask, '\'
16 @ newline, '[\r\n]'
17 @ blank, '[[:blank:]]'
18 @ word, '[[:alnum:]_]'
19 @ punct '[[:punct:]]'
20 @ eof(end of file)
22     and recognize RSV-WD & punct token by looking up defination array, and can be
23 defined more flexiable.
24     it append nest state proc in token parsing.
25         it uses shell script to parsing gmr defination to c code array defination, and
26 grammar defines virtual token as a symbol that can be exported to other grammar
27 definations. it's just for feature of nest grammar.
28     in reglxgmr, lxr and gmr defination can be in different srcpkg, even can be loaded
29 in runtime for grammar extension.
31     it translate language grammar element to ElemDesc, which is sourced from
32 bourne again shell program for script running.
34     reglxgmr can be used for:
36 @ lang front-end processing for a language, script, compiler, editor, txt-parser.
37 @ study of regular expression, lexer, and grammar.
41 # features
42 ----------
44     it implement those primary function features:
46 @ regular expressioin matching
47 @ lexer analyzing
48 @ grammar prcessing
49 @ elem desc defination for general lang implement
50   it fills grammar processing result into elem desc as an interface. elem des 
51   variable can be accessed by script parser, compiler, or normal script program.
52 @ proc program in grammar can be c func, or shell script program.
54     and other misc features:
56 @ charset: char type judgement.
57 @ Regex2NFA, NFA2DFA, DFA2MIN: regex/nfa/dfa translation.
58 @ IOStrm: buff/fifo/pipe in same thread or fiber/thread/process.
59 @ ivk-list, ivk-stack: invoke func in chain.
60 @ idxstr: reference string by index value.
62     the external feature it depends:
64 @ SQLTGA, an implementation of data structure.
65 @ plugin, extend lang-implement by plugin in runtime.
66 @ Allocator, it's an optional dependence for memory allocating.
67 @ dvar, to store and access elem desc from grammar output, so that those elem
68   desc can be used in multiple different language, not just c code.
72 # compile & backup
73 ------------------
75     it's different from traditional srcpkg, it compile srcpkg just only by compiler
76 and shell script programs.
77     if you want to compile program, type this cmd.
79 ```
80 $ ./cmpl.sh
81 ```
83     clean files by this cmd.
85 ```
86 $ ./cmpl.sh clean
87 ```
89     backup srcpkg to the dir setting in var of 'BAKDIR' in cmpl.sh by this cmd.
91 ```
92 $ ./cmpl.sh bak
93 ```