X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/048d0b2d143b6a491ac73eed6ab972e97774391c..ea578bb4b9eb4a03b2eb4ed151e058d699c216ea:/src/c-types-parse.lisp diff --git a/src/c-types-parse.lisp b/src/c-types-parse.lisp index e3ac625..5f2e438 100644 --- a/src/c-types-parse.lisp +++ b/src/c-types-parse.lisp @@ -290,7 +290,7 @@ ;;; `parse-declarator' will be of this form. (export 'parse-declarator) -(defun parse-declarator (scanner base-type &key centre abstractp) +(defun parse-declarator (scanner base-type &key kernel abstractp) "Parse a C declarator, returning a pair (C-TYPE . NAME). The SCANNER is a token scanner to read from. The BASE-TYPE is the type @@ -299,16 +299,16 @@ The result contains both the resulting constructed C-TYPE (with any qualifiers etc. as necessary), and the name from the middle of the - declarator. The name is parsed using the CENTRE parser provided, and + declarator. The name is parsed using the KERNEL parser provided, and defaults to matching a simple identifier `:id'. This might, e.g., be (? :id) to parse an `abstract declarator' which has optional names. - There's an annoying ambiguity in the syntax, if an empty CENTRE is + There's an annoying ambiguity in the syntax, if an empty KERNEL is permitted. In this case, you must ensure that ABSTRACTP is true so that the appropriate heuristic can be applied. As a convenience, if ABSTRACTP - is true then `(? :id)' is used as the default CENTRE." + is true then `(? :id)' is used as the default KERNEL." (with-parser-context (token-scanner-context :scanner scanner) - (let ((centre-parser (cond (centre centre) + (let ((kernel-parser (cond (kernel kernel) (abstractp (parser () (? :id))) (t (parser () :id))))) @@ -362,8 +362,8 @@ (values t t nil)))) (lparen #\)))))) - (centre () - (parse (seq ((name (funcall centre-parser))) + (kernel () + (parse (seq ((name (funcall kernel-parser))) (cons #'identity name)))) (argument-list () @@ -408,7 +408,7 @@ (parse (seq ((value (expr (:nestedp nestedp) ;; An actual operand. - (centre) + (kernel) ;; Binary operators. There aren't any. nil