factor: more syntax work.
parent
dfc87db5df
commit
d5bc631401
|
@ -42,12 +42,12 @@ HELP: run-dataflow-analysis
|
|||
|
||||
PRIVATE>
|
||||
|
||||
HELP: FORWARD-ANALYSIS:
|
||||
{ $syntax "FORWARD-ANALYSIS: word" }
|
||||
HELP: forward-analysis:
|
||||
{ $syntax "forward-analysis: word" }
|
||||
{ $values { "word" "name of the compiler pass" } }
|
||||
{ $description "Syntax word for defining a forward analysis compiler pass." } ;
|
||||
|
||||
HELP: BACKWARD-ANALYSIS:
|
||||
{ $syntax "BACKWARD-ANALYSIS: word" }
|
||||
HELP: backward-analysis:
|
||||
{ $syntax "backward-analysis: word" }
|
||||
{ $values { "word" "name of the compiler pass" } }
|
||||
{ $description "Syntax word for defining a backward analysis compiler pass." } ;
|
||||
|
|
|
@ -133,8 +133,8 @@ INSTANCE: name backward-analysis ;
|
|||
|
||||
PRIVATE>
|
||||
|
||||
SYNTAX: FORWARD-ANALYSIS:
|
||||
SYNTAX: forward-analysis:
|
||||
scan-token [ define-analysis ] [ define-forward-analysis ] bi ;
|
||||
|
||||
SYNTAX: BACKWARD-ANALYSIS:
|
||||
SYNTAX: backward-analysis:
|
||||
scan-token [ define-analysis ] [ define-backward-analysis ] bi ;
|
||||
|
|
|
@ -17,7 +17,7 @@ in: compiler.cfg.gvn.avail
|
|||
! This doesn't propagate across "kill blocks". Not sure if
|
||||
! that's right, though I may as well assume as much.
|
||||
|
||||
FORWARD-ANALYSIS: avail
|
||||
forward-analysis: avail
|
||||
|
||||
M: avail transfer-set drop defined assoc-union ;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ C: <ds-loc> ds-loc ;
|
|||
TUPLE: rs-loc < loc ;
|
||||
C: <rs-loc> rs-loc ;
|
||||
|
||||
SYNTAX: D: scan-number <ds-loc> suffix! ;
|
||||
SYNTAX: d: scan-number <ds-loc> suffix! ;
|
||||
SYNTAX: d: scan-number <ds-loc> suffix! ;
|
||||
SYNTAX: r: scan-number <rs-loc> suffix! ;
|
||||
SYNTAX: R: scan-number <rs-loc> suffix! ;
|
||||
SYNTAX: r: scan-number <rs-loc> suffix! ;
|
||||
|
|
|
@ -15,29 +15,29 @@ in: compiler.cfg.stacks.global
|
|||
: transfer-peeked-locs ( set bb -- set' )
|
||||
[ replace-set diff ] [ peek-set union ] bi ;
|
||||
|
||||
BACKWARD-ANALYSIS: anticip
|
||||
backward-analysis: anticip
|
||||
|
||||
M: anticip transfer-set drop transfer-peeked-locs ;
|
||||
M: anticip join-sets 2drop refine ;
|
||||
|
||||
BACKWARD-ANALYSIS: live
|
||||
backward-analysis: live
|
||||
|
||||
M: live transfer-set drop transfer-peeked-locs ;
|
||||
M: live join-sets 2drop combine ;
|
||||
|
||||
FORWARD-ANALYSIS: avail
|
||||
forward-analysis: avail
|
||||
|
||||
M: avail transfer-set
|
||||
drop [ peek-set ] [ replace-set ] bi union union ;
|
||||
M: avail join-sets 2drop refine ;
|
||||
|
||||
FORWARD-ANALYSIS: pending
|
||||
forward-analysis: pending
|
||||
|
||||
M: pending transfer-set
|
||||
drop replace-set union ;
|
||||
M: pending join-sets 2drop refine ;
|
||||
|
||||
BACKWARD-ANALYSIS: dead
|
||||
backward-analysis: dead
|
||||
|
||||
M: dead transfer-set
|
||||
drop [ kill-set ] [ replace-set ] bi union union ;
|
||||
|
|
|
@ -77,7 +77,7 @@ M: ##peek visit-insn ( state insn -- state )
|
|||
M: insn visit-insn ( state insn -- state' )
|
||||
drop ;
|
||||
|
||||
FORWARD-ANALYSIS: padding
|
||||
forward-analysis: padding
|
||||
|
||||
symbol: stack-record
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ symbol: registers
|
|||
|
||||
V{ } registers set-global
|
||||
|
||||
SYNTAX: REGISTER:
|
||||
SYNTAX: register:
|
||||
scan-new-word
|
||||
[ define-symbol ]
|
||||
[ registers get length "register" set-word-prop ]
|
||||
|
@ -20,22 +20,22 @@ SYNTAX: REGISTER:
|
|||
|
||||
>>
|
||||
|
||||
REGISTER: R0
|
||||
REGISTER: R1
|
||||
REGISTER: R2
|
||||
REGISTER: R3
|
||||
REGISTER: R4
|
||||
REGISTER: R5
|
||||
REGISTER: R6
|
||||
REGISTER: R7
|
||||
REGISTER: R8
|
||||
REGISTER: R9
|
||||
REGISTER: R10
|
||||
REGISTER: R11
|
||||
REGISTER: R12
|
||||
REGISTER: R13
|
||||
REGISTER: R14
|
||||
REGISTER: R15
|
||||
register: R0
|
||||
register: R1
|
||||
register: R2
|
||||
register: R3
|
||||
register: R4
|
||||
register: R5
|
||||
register: R6
|
||||
register: R7
|
||||
register: R8
|
||||
register: R9
|
||||
register: R10
|
||||
register: R11
|
||||
register: R12
|
||||
register: R13
|
||||
register: R14
|
||||
register: R15
|
||||
|
||||
ALIAS: SL R10 ; ALIAS: FP R11 ; ALIAS: IP R12 ;
|
||||
ALIAS: SP R13 ; ALIAS: LR R14 ; ALIAS: PC R15 ;
|
||||
|
|
|
@ -34,7 +34,7 @@ CONSTANT: seh-names
|
|||
{ $ STATUS_FLOAT_MULTIPLE_FAULTS "STATUS_FLOAT_MULTIPLE_FAULTS" }
|
||||
{ $ STATUS_FLOAT_MULTIPLE_TRAPS "STATUS_FLOAT_MULTIPLE_TRAPS" }
|
||||
{ 0xe06d7363 "Visual C++ exception" }
|
||||
}
|
||||
} ;
|
||||
|
||||
: seh-name. ( n -- )
|
||||
seh-names at [ " (" ")" surround write ] when* ;
|
||||
|
|
|
@ -24,20 +24,20 @@ icons [ H{ } clone ] initialize
|
|||
define
|
||||
] 2bi ;
|
||||
|
||||
SYNTAX: ICON: scan-word scan-token define-icon ;
|
||||
SYNTAX: ICON: scan-word scan-token ";" expect define-icon ;
|
||||
|
||||
>>
|
||||
|
||||
ICON: predicate-class class-predicate-word
|
||||
ICON: generic generic-word
|
||||
ICON: macro macro-word
|
||||
ICON: parsing-word parsing-word
|
||||
ICON: primitive primitive-word
|
||||
ICON: symbol symbol-word
|
||||
ICON: constant constant-word
|
||||
ICON: word normal-word
|
||||
ICON: word-link word-help-article
|
||||
ICON: topic help-article
|
||||
ICON: runnable-vocab runnable-vocab
|
||||
ICON: vocab open-vocab
|
||||
ICON: vocab-link unopen-vocab
|
||||
ICON: predicate-class class-predicate-word ;
|
||||
ICON: generic generic-word ;
|
||||
ICON: macro macro-word ;
|
||||
ICON: parsing-word parsing-word ;
|
||||
ICON: primitive primitive-word ;
|
||||
ICON: symbol symbol-word ;
|
||||
ICON: constant constant-word ;
|
||||
ICON: word normal-word ;
|
||||
ICON: word-link word-help-article ;
|
||||
ICON: topic help-article ;
|
||||
ICON: runnable-vocab runnable-vocab ;
|
||||
ICON: vocab open-vocab ;
|
||||
ICON: vocab-link unopen-vocab ;
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
USING: io.encodings.iana io.encodings.euc ;
|
||||
in: io.encodings.big5
|
||||
|
||||
EUC: big5 "vocab:io/encodings/big5/CP950.TXT"
|
||||
EUC: big5 "vocab:io/encodings/big5/CP950.TXT" ;
|
||||
|
||||
big5 "Big5" register-encoding
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
USING: io.encodings.euc io.encodings.iana ;
|
||||
in: io.encodings.euc-jp
|
||||
|
||||
EUC: euc-jp "vocab:io/encodings/euc-jp/euc-jp-2000-std.txt"
|
||||
EUC: euc-jp "vocab:io/encodings/euc-jp/euc-jp-2000-std.txt" ;
|
||||
|
||||
euc-jp "Extended_UNIX_Code_Packed_Format_for_Japanese" register-encoding
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
USING: io.encodings.iana io.encodings.euc ;
|
||||
in: io.encodings.euc-kr
|
||||
|
||||
EUC: euc-kr "vocab:io/encodings/euc-kr/data/cp949.txt"
|
||||
EUC: euc-kr "vocab:io/encodings/euc-kr/data/cp949.txt" ;
|
||||
|
||||
euc-kr "EUC-KR" register-encoding
|
||||
|
|
|
@ -64,5 +64,5 @@ symbol: euc-table
|
|||
PRIVATE>
|
||||
|
||||
SYNTAX: EUC:
|
||||
! EUC: euc-kr "vocab:io/encodings/korean/cp949.txt"
|
||||
scan-new-class scan-object define-euc ;
|
||||
! EUC: euc-kr "vocab:io/encodings/korean/cp949.txt" ;
|
||||
scan-new-class scan-object ";" expect define-euc ;
|
||||
|
|
|
@ -33,10 +33,10 @@ M: iso2022 <decoder>
|
|||
|
||||
CONSTANT: ESC 0x16 ;
|
||||
|
||||
CONSTANT: switch-ascii B{ $ ESC char: ( char: B } ;
|
||||
CONSTANT: switch-jis201 B{ $ ESC char: ( char: J } ;
|
||||
CONSTANT: switch-ascii B{ $ ESC char: \( char: B } ;
|
||||
CONSTANT: switch-jis201 B{ $ ESC char: \( char: J } ;
|
||||
CONSTANT: switch-jis208 B{ $ ESC char: $ char: B } ;
|
||||
CONSTANT: switch-jis212 B{ $ ESC char: $ char: ( char: D } ;
|
||||
CONSTANT: switch-jis212 B{ $ ESC char: $ char: \( char: D } ;
|
||||
|
||||
: find-type ( char -- code type )
|
||||
{
|
||||
|
@ -62,7 +62,7 @@ M:: iso2022-state encode-char ( char stream encoding -- )
|
|||
|
||||
: read-escape ( stream -- type/f )
|
||||
dup stream-read1 {
|
||||
{ char: ( [
|
||||
{ char: \( [
|
||||
stream-read1 {
|
||||
{ char: B [ ascii get-global ] }
|
||||
{ char: J [ jis201 get-global ] }
|
||||
|
@ -73,7 +73,7 @@ M:: iso2022-state encode-char ( char stream encoding -- )
|
|||
dup stream-read1 {
|
||||
{ char: @ [ drop jis208 get-global ] } ! want: JIS X 0208-1978
|
||||
{ char: B [ drop jis208 get-global ] }
|
||||
{ char: ( [
|
||||
{ char: \( [
|
||||
stream-read1 char: D = jis212 get-global f ?
|
||||
] }
|
||||
[ 2drop f ]
|
||||
|
|
|
@ -3,4 +3,4 @@
|
|||
use: io.encodings.euc
|
||||
in: io.encodings.johab
|
||||
|
||||
EUC: johab "vocab:io/encodings/johab/johab.txt"
|
||||
EUC: johab "vocab:io/encodings/johab/johab.txt" ;
|
||||
|
|
|
@ -150,7 +150,7 @@ ERROR: not-absolute-path ;
|
|||
unicode-prefix ?head drop
|
||||
dup {
|
||||
[ length 2 >= ]
|
||||
[ second char: : = ]
|
||||
[ second char: \: = ]
|
||||
[ first Letter? ]
|
||||
} 1&& [ 2 head "\\" append ] [ not-absolute-path ] if ;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ CONSTANT: share-mode
|
|||
FILE_SHARE_READ
|
||||
FILE_SHARE_WRITE
|
||||
FILE_SHARE_DELETE
|
||||
}
|
||||
} ;
|
||||
|
||||
: default-security-attributes ( -- obj )
|
||||
SECURITY_ATTRIBUTES <struct>
|
||||
|
@ -332,7 +332,7 @@ M: windows root-directory? ( path -- ? )
|
|||
{ [ dup empty? ] [ drop f ] }
|
||||
{ [ dup [ path-separator? ] all? ] [ drop t ] }
|
||||
{ [ dup trim-tail-separators { [ length 2 = ]
|
||||
[ second char: : = ] } 1&& ] [ drop t ] }
|
||||
[ second char: \: = ] } 1&& ] [ drop t ] }
|
||||
{ [ dup unicode-prefix head? ]
|
||||
[ trim-tail-separators length unicode-prefix length 2 + = ] }
|
||||
[ drop f ]
|
||||
|
|
|
@ -11,9 +11,9 @@ in: parser-combinators.simple
|
|||
[ digit? ] satisfy <*> [ string>number ] <@ ;
|
||||
|
||||
: string-parser ( -- parser )
|
||||
[ char: " = ] satisfy
|
||||
[ char: " = not ] satisfy <*> &>
|
||||
[ char: " = ] satisfy <& [ >string ] <@ ;
|
||||
[ char: \" = ] satisfy
|
||||
[ char: \" = not ] satisfy <*> &>
|
||||
[ char: \" = ] satisfy <& [ >string ] <@ ;
|
||||
|
||||
: bold-parser ( -- parser )
|
||||
"*" token
|
||||
|
|
|
@ -74,9 +74,9 @@ PRIVATE>
|
|||
|
||||
: string-parser ( -- parser )
|
||||
[
|
||||
[ char: " = ] satisfy hide ,
|
||||
[ char: " = not ] satisfy repeat0 ,
|
||||
[ char: " = ] satisfy hide ,
|
||||
[ char: \" = ] satisfy hide ,
|
||||
[ char: \" = not ] satisfy repeat0 ,
|
||||
[ char: \" = ] satisfy hide ,
|
||||
] seq* [ first >string ] action ;
|
||||
|
||||
: (range-pattern) ( pattern -- string )
|
||||
|
|
Loading…
Reference in New Issue