mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-19 17:53:00 +01:00
mescc-tools-extra contains two important tools: - cp - chmod mes first builds itself from a mes 0.21 seed as used by guix, and then builds a mes 0.22 and then mes 0.22 using that created mes 0.22. It does /not/ use bootstrap.sh as we don't have a proper shell at this point, it has been manually adapted for kaem.
148 lines
6.2 KiB
Scheme
148 lines
6.2 KiB
Scheme
;; c99cx-act.scm
|
|
|
|
;; Copyright (C) 2018 Matthew R. Wette
|
|
;;
|
|
;; This library is free software; you can redistribute it and/or
|
|
;; modify it under the terms of the GNU Lesser General Public
|
|
;; License as published by the Free Software Foundation; either
|
|
;; version 3 of the License, or (at your option) any later version.
|
|
;; See the file COPYING included with the this distribution.
|
|
|
|
(define c99cx-act-v
|
|
(vector
|
|
;; $start => constant-expression
|
|
(lambda ($1 . $rest) $1)
|
|
;; primary-expression => identifier
|
|
(lambda ($1 . $rest) `(p-expr ,$1))
|
|
;; primary-expression => constant
|
|
(lambda ($1 . $rest) `(p-expr ,$1))
|
|
;; primary-expression => string-literal
|
|
(lambda ($1 . $rest) `(p-expr ,(tl->list $1)))
|
|
;; primary-expression => "(" constant-expression ")"
|
|
(lambda ($3 $2 $1 . $rest) $2)
|
|
;; postfix-expression => primary-expression
|
|
(lambda ($1 . $rest) $1)
|
|
;; postfix-expression => postfix-expression "[" constant-expression "]"
|
|
(lambda ($4 $3 $2 $1 . $rest)
|
|
`(array-ref ,$3 ,$1))
|
|
;; postfix-expression => postfix-expression "." identifier
|
|
(lambda ($3 $2 $1 . $rest) `(d-sel ,$3 ,$1))
|
|
;; postfix-expression => postfix-expression "->" identifier
|
|
(lambda ($3 $2 $1 . $rest) `(i-sel ,$3 ,$1))
|
|
;; postfix-expression => postfix-expression "++"
|
|
(lambda ($2 $1 . $rest) `(post-inc ,$1))
|
|
;; postfix-expression => postfix-expression "--"
|
|
(lambda ($2 $1 . $rest) `(post-dec ,$1))
|
|
;; unary-expression => postfix-expression
|
|
(lambda ($1 . $rest) $1)
|
|
;; unary-expression => "++" unary-expression
|
|
(lambda ($2 $1 . $rest) `(pre-inc ,$2))
|
|
;; unary-expression => "--" unary-expression
|
|
(lambda ($2 $1 . $rest) `(pre-dec ,$2))
|
|
;; unary-expression => unary-operator cast-expression
|
|
(lambda ($2 $1 . $rest) (list $1 $2))
|
|
;; unary-expression => "sizeof" unary-expression
|
|
(lambda ($2 $1 . $rest) `(sizeof-expr ,$2))
|
|
;; unary-operator => "&"
|
|
(lambda ($1 . $rest) 'ref-to)
|
|
;; unary-operator => "*"
|
|
(lambda ($1 . $rest) 'de-ref)
|
|
;; unary-operator => "+"
|
|
(lambda ($1 . $rest) 'pos)
|
|
;; unary-operator => "-"
|
|
(lambda ($1 . $rest) 'neg)
|
|
;; unary-operator => "~"
|
|
(lambda ($1 . $rest) 'bitwise-not)
|
|
;; unary-operator => "!"
|
|
(lambda ($1 . $rest) 'not)
|
|
;; cast-expression => unary-expression
|
|
(lambda ($1 . $rest) $1)
|
|
;; multiplicative-expression => cast-expression
|
|
(lambda ($1 . $rest) $1)
|
|
;; multiplicative-expression => multiplicative-expression "*" cast-expre...
|
|
(lambda ($3 $2 $1 . $rest) `(mul ,$1 ,$3))
|
|
;; multiplicative-expression => multiplicative-expression "/" cast-expre...
|
|
(lambda ($3 $2 $1 . $rest) `(div ,$1 ,$3))
|
|
;; multiplicative-expression => multiplicative-expression "%" cast-expre...
|
|
(lambda ($3 $2 $1 . $rest) `(mod ,$1 ,$3))
|
|
;; additive-expression => multiplicative-expression
|
|
(lambda ($1 . $rest) $1)
|
|
;; additive-expression => additive-expression "+" multiplicative-expression
|
|
(lambda ($3 $2 $1 . $rest) `(add ,$1 ,$3))
|
|
;; additive-expression => additive-expression "-" multiplicative-expression
|
|
(lambda ($3 $2 $1 . $rest) `(sub ,$1 ,$3))
|
|
;; shift-expression => additive-expression
|
|
(lambda ($1 . $rest) $1)
|
|
;; shift-expression => shift-expression "<<" additive-expression
|
|
(lambda ($3 $2 $1 . $rest) `(lshift ,$1 ,$3))
|
|
;; shift-expression => shift-expression ">>" additive-expression
|
|
(lambda ($3 $2 $1 . $rest) `(rshift ,$1 ,$3))
|
|
;; relational-expression => shift-expression
|
|
(lambda ($1 . $rest) $1)
|
|
;; relational-expression => relational-expression "<" shift-expression
|
|
(lambda ($3 $2 $1 . $rest) `(lt ,$1 ,$3))
|
|
;; relational-expression => relational-expression ">" shift-expression
|
|
(lambda ($3 $2 $1 . $rest) `(gt ,$1 ,$3))
|
|
;; relational-expression => relational-expression "<=" shift-expression
|
|
(lambda ($3 $2 $1 . $rest) `(le ,$1 ,$3))
|
|
;; relational-expression => relational-expression ">=" shift-expression
|
|
(lambda ($3 $2 $1 . $rest) `(ge ,$1 ,$3))
|
|
;; equality-expression => relational-expression
|
|
(lambda ($1 . $rest) $1)
|
|
;; equality-expression => equality-expression "==" relational-expression
|
|
(lambda ($3 $2 $1 . $rest) `(eq ,$1 ,$3))
|
|
;; equality-expression => equality-expression "!=" relational-expression
|
|
(lambda ($3 $2 $1 . $rest) `(ne ,$1 ,$3))
|
|
;; bitwise-and-expression => equality-expression
|
|
(lambda ($1 . $rest) $1)
|
|
;; bitwise-and-expression => bitwise-and-expression "&" equality-expression
|
|
(lambda ($3 $2 $1 . $rest)
|
|
`(bitwise-and ,$1 ,$3))
|
|
;; bitwise-xor-expression => bitwise-and-expression
|
|
(lambda ($1 . $rest) $1)
|
|
;; bitwise-xor-expression => bitwise-xor-expression "^" bitwise-and-expr...
|
|
(lambda ($3 $2 $1 . $rest)
|
|
`(bitwise-xor ,$1 ,$3))
|
|
;; bitwise-or-expression => bitwise-xor-expression
|
|
(lambda ($1 . $rest) $1)
|
|
;; bitwise-or-expression => bitwise-or-expression "|" bitwise-xor-expres...
|
|
(lambda ($3 $2 $1 . $rest) `(bitwise-or ,$1 ,$3))
|
|
;; logical-and-expression => bitwise-or-expression
|
|
(lambda ($1 . $rest) $1)
|
|
;; logical-and-expression => logical-and-expression "&&" bitwise-or-expr...
|
|
(lambda ($3 $2 $1 . $rest) `(and ,$1 ,$3))
|
|
;; logical-or-expression => logical-and-expression
|
|
(lambda ($1 . $rest) $1)
|
|
;; logical-or-expression => logical-or-expression "||" logical-and-expre...
|
|
(lambda ($3 $2 $1 . $rest) `(or ,$1 ,$3))
|
|
;; conditional-expression => logical-or-expression
|
|
(lambda ($1 . $rest) $1)
|
|
;; conditional-expression => logical-or-expression "?" constant-expressi...
|
|
(lambda ($5 $4 $3 $2 $1 . $rest)
|
|
`(cond-expr ,$1 ,$3 ,$5))
|
|
;; constant-expression => conditional-expression
|
|
(lambda ($1 . $rest) $1)
|
|
;; identifier => '$ident
|
|
(lambda ($1 . $rest) `(ident ,$1))
|
|
;; constant => '$fixed
|
|
(lambda ($1 . $rest) `(fixed ,$1))
|
|
;; constant => '$float
|
|
(lambda ($1 . $rest) `(float ,$1))
|
|
;; constant => '$chlit
|
|
(lambda ($1 . $rest) `(char ,$1))
|
|
;; constant => '$chlit/L
|
|
(lambda ($1 . $rest)
|
|
`(char (@ (type "wchar_t")) ,$1))
|
|
;; constant => '$chlit/u
|
|
(lambda ($1 . $rest)
|
|
`(char (@ (type "char16_t")) ,$1))
|
|
;; constant => '$chlit/U
|
|
(lambda ($1 . $rest)
|
|
`(char (@ (type "char32_t")) ,$1))
|
|
;; string-literal => '$string
|
|
(lambda ($1 . $rest) (make-tl 'string $1))
|
|
;; string-literal => string-literal '$string
|
|
(lambda ($2 $1 . $rest) (tl-append $1 $2))
|
|
))
|
|
|
|
;;; end tables
|