123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240 |
- (eval-and-compile
- (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
- (eval-when-compile
- (let ((load-path
- (if (and (boundp 'byte-compile-dest-file)
- (stringp byte-compile-dest-file))
- (cons (file-name-directory byte-compile-dest-file) load-path)
- load-path)))
- (load "cc-bytecomp" nil t)))
- (cc-require 'cc-defs)
- (cc-require 'cc-vars)
- (cc-external-require 'cl)
- (eval-and-compile
-
-
-
-
-
- (defvar c-lang-variable-inits nil)
- (defvar c-lang-variable-inits-tail nil)
- (setq c-lang-variable-inits (list nil)
- c-lang-variable-inits-tail c-lang-variable-inits)
- (defvar c-emacs-variable-inits nil)
- (defvar c-emacs-variable-inits-tail nil)
- (setq c-emacs-variable-inits (list nil)
- c-emacs-variable-inits-tail c-emacs-variable-inits))
- (defmacro c-lang-defvar (var val &optional doc)
- "Declares the buffer local variable VAR to get the value VAL. VAL is
- evaluated and assigned at mode initialization. More precisely, VAL is
- evaluated and bound to VAR when the result from the macro
- `c-init-language-vars' is evaluated.
- `c-lang-const' is typically used in VAL to get the right value for the
- language being initialized, and such calls will be macro expanded to
- the evaluated constant value at compile time."
- (when (and (not doc)
- (eq (car-safe val) 'c-lang-const)
- (eq (nth 1 val) var)
- (not (nth 2 val)))
-
-
-
- (setq doc (get (intern (symbol-name (nth 1 val)) c-lang-constants)
- 'variable-documentation)))
- (or (stringp doc)
- (setq doc nil))
- (let ((elem (assq var (cdr c-lang-variable-inits))))
- (if elem
- (setcdr elem (list val doc))
- (setcdr c-lang-variable-inits-tail (list (list var val doc)))
- (setq c-lang-variable-inits-tail (cdr c-lang-variable-inits-tail))))
-
- `',var)
- (defmacro c-lang-setvar (var val)
- "Causes the variable VAR to be made buffer local and to get set to the
- value VAL. VAL is evaluated and assigned at mode initialization. More
- precisely, VAL is evaluated and bound to VAR when the result from the
- macro `c-init-language-vars' is evaluated. VAR is typically a standard
- Emacs variable like `comment-start'.
- `c-lang-const' is typically used in VAL to get the right value for the
- language being initialized, and such calls will be macro expanded to
- the evaluated constant value at compile time."
- (let ((elem (assq var (cdr c-emacs-variable-inits))))
- (if elem
- (setcdr elem (list val))
- (setcdr c-emacs-variable-inits-tail (list (list var val)))
- (setq c-emacs-variable-inits-tail (cdr c-emacs-variable-inits-tail))))
-
- `',var)
- (put 'c-lang-defvar 'lisp-indent-function 'defun)
- (def-edebug-spec c-lang-defvar
- (&define name def-form &optional stringp))
- (declare-function delete-duplicates "cl-seq" (cl-seq &rest cl-keys))
- (declare-function mapcan "cl-extra" (cl-func cl-seq &rest cl-rest))
- (declare-function cl-macroexpand-all "cl-extra" (form &optional env))
- (eval-and-compile
-
- (defun c-filter-ops (ops opgroup-filter op-filter &optional xlate)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- (unless (listp (car-safe ops))
- (setq ops (list ops)))
- (cond ((eq opgroup-filter t)
- (setq opgroup-filter (lambda (opgroup) t)))
- ((not (functionp opgroup-filter))
- (setq opgroup-filter `(lambda (opgroup)
- (memq opgroup ',opgroup-filter)))))
- (cond ((eq op-filter t)
- (setq op-filter (lambda (op) t)))
- ((stringp op-filter)
- (setq op-filter `(lambda (op)
- (string-match ,op-filter op)))))
- (unless xlate
- (setq xlate 'identity))
- (c-with-syntax-table (c-lang-const c-mode-syntax-table)
- (delete-duplicates
- (mapcan (lambda (opgroup)
- (when (if (symbolp (car opgroup))
- (when (funcall opgroup-filter (car opgroup))
- (setq opgroup (cdr opgroup))
- t)
- t)
- (mapcan (lambda (op)
- (when (funcall op-filter op)
- (let ((res (funcall xlate op)))
- (if (listp res) res (list res)))))
- opgroup)))
- ops)
- :test 'equal))))
- (c-lang-defconst c-mode-menu
-
-
- t `(["Comment Out Region" comment-region
- (c-fn-region-is-active-p)]
- ["Uncomment Region" (-region (region-beginning)
- (region-end) '(4))
- (c-fn-region-is-active-p)]
- ["Indent Expression" c-indent-exp
- (memq (char-after) '(?\( ?\[ ?\{))]
- ["Indent Line or Region" c-indent-line-or-region t]
- ["Fill Comment Paragraph" c-fill-paragraph t]
- "----"
- ["Backward Statement" c-beginning-of-statement t]
- ["Forward Statement" c-end-of-statement t]
- ,@(when (c-lang-const c-opt-cpp-prefix)
-
- `(["Up Conditional" c-up-conditional t]
- ["Backward Conditional" c-backward-conditional t]
- ["Forward Conditional" c-forward-conditional t]
- "----"
- ["Macro Expand Region" c-macro-expand
- (c-fn-region-is-active-p)]
- ["Backslashify" c-backslash-region
- (c-fn-region-is-active-p)]))
- "----"
- ("Style..."
- ["Set Style..." c-set-style t]
- ["Show Current Style Name" (message
- "Style Name: %s"
- c-indentation-style) t]
- ["Guess Style from this Buffer" c-guess-buffer-no-install t]
- ["Install the Last Guessed Style..." c-guess-install
- (and c-guess-guessed-offsets-alist
- c-guess-guessed-basic-offset) ]
- ["View the Last Guessed Style" c-guess-view
- (and c-guess-guessed-offsets-alist
- c-guess-guessed-basic-offset) ])
- "----"
- ("Toggle..."
- ["Syntactic indentation" c-toggle-syntactic-indentation
- :style toggle :selected c-syntactic-indentation]
- ["Electric mode" c-toggle-electric-state
- :style toggle :selected c-electric-flag]
- ["Auto newline" c-toggle-auto-newline
- :style toggle :selected c-auto-newline]
- ["Hungry delete" c-toggle-hungry-state
- :style toggle :selected c-hungry-delete-key]
- ["Subword mode" subword-mode
- :style toggle :selected (and (boundp 'subword-mode)
- subword-mode)])))
- (defun c-populate-syntax-table (table)
- "Populate the given syntax table as necessary for a C-like language.
- This includes setting ' and \" as string delimiters, and setting up
- the comment syntax to handle both line style \"//\" and block style
- \"/*\" \"*/\" comments."
- (modify-syntax-entry ?_ "_" table)
- (modify-syntax-entry ?\\ "\\" table)
- (modify-syntax-entry ?+ "." table)
- (modify-syntax-entry ?- "." table)
- (modify-syntax-entry ?= "." table)
- (modify-syntax-entry ?% "." table)
- (modify-syntax-entry ?< "." table)
- (modify-syntax-entry ?> "." table)
- (modify-syntax-entry ?& "." table)
- (modify-syntax-entry ?| "." table)
- (modify-syntax-entry ?\' "\"" table)
- (modify-syntax-entry ?\240 "." table)
-
-
-
-
- (cond
-
- ((memq '8-bit c-emacs-features)
- (modify-syntax-entry ?/ ". 1456" table)
- (modify-syntax-entry ?* ". 23" table))
-
- ((memq '1-bit c-emacs-features)
- (modify-syntax-entry ?/ ". 124b" table)
- (modify-syntax-entry ?* ". 23" table))
-
- (t (error "CC Mode is incompatible with this version of Emacs")))
- (modify-syntax-entry ?\n "> b" table)
-
- (modify-syntax-entry ?\ "> b" table))
- (c-lang-defconst c-make-mode-syntax-table
- "Functions that generates the mode specific syntax tables.
- The syntax tables aren't stored directly since they're quite large."
- t `(lambda ()
- (let ((table (make-syntax-table)))
- (c-populate-syntax-table table)
-
- ,(cond ((or (c-major-mode-is 'objc-mode) (c-major-mode-is 'java-mode))
-
-
-
-
- `(modify-syntax-entry ?@ "_" table))
- ((c-major-mode-is 'pike-mode)
- `(modify-syntax-entry ?@ "." table)))
- table)))
- (c-lang-defconst c-mode-syntax-table
-
-
- t (funcall (c-lang-const c-make-mode-syntax-table)))
- (c-lang-defconst c++-make-template-syntax-table
-
-
-
-
-
-
- t nil
- (java c++) `(lambda ()
- (let ((table (funcall ,(c-lang-const c-make-mode-syntax-table))))
- (modify-syntax-entry ?< "(>" table)
- (modify-syntax-entry ?> ")<" table)
- table)))
- (c-lang-defvar c++-template-syntax-table
- (and (c-lang-const c++-make-template-syntax-table)
- (funcall (c-lang-const c++-make-template-syntax-table))))
- (c-lang-defconst c-no-parens-syntax-table
-
-
-
-
-
-
-
- t `(lambda ()
- (if (c-lang-const c-recognize-<>-arglists)
- (let ((table (funcall ,(c-lang-const c-make-mode-syntax-table))))
- (modify-syntax-entry ?\( "." table)
- (modify-syntax-entry ?\) "." table)
- (modify-syntax-entry ?\[ "." table)
- (modify-syntax-entry ?\] "." table)
- (modify-syntax-entry ?\{ "." table)
- (modify-syntax-entry ?\} "." table)
- table))))
- (c-lang-defvar c-no-parens-syntax-table
- (funcall (c-lang-const c-no-parens-syntax-table)))
- (c-lang-defconst c-identifier-syntax-modifications
- "A list that describes the modifications that should be done to the
- mode syntax table to get a syntax table that matches all identifiers
- and keywords as words.
- The list is just like the one used in `font-lock-defaults': Each
- element is a cons where the car is the character to modify and the cdr
- the new syntax, as accepted by `modify-syntax-entry'."
-
-
-
-
- t '((?_ . "w") (?$ . "w"))
- (objc java) (append '((?@ . "w"))
- (c-lang-const c-identifier-syntax-modifications))
- awk '((?_ . "w")))
- (c-lang-defvar c-identifier-syntax-modifications
- (c-lang-const c-identifier-syntax-modifications))
- (c-lang-defvar c-identifier-syntax-table
- (let ((table (copy-syntax-table (c-mode-var "mode-syntax-table")))
- (mods c-identifier-syntax-modifications)
- mod)
- (while mods
- (setq mod (car mods)
- mods (cdr mods))
- (modify-syntax-entry (car mod) (cdr mod) table))
- table)
- "Syntax table built on the mode syntax table but additionally
- classifies symbol constituents like '_' and '$' as word constituents,
- so that all identifiers are recognized as words.")
- (c-lang-defconst c-get-state-before-change-functions
-
-
- t nil
- c++ '(c-extend-region-for-CPP
- c-before-change-check-<>-operators
- c-invalidate-macro-cache)
- (c objc) '(c-extend-region-for-CPP c-invalidate-macro-cache)
-
- awk 'c-awk-record-region-clear-NL)
- (c-lang-defvar c-get-state-before-change-functions
- (let ((fs (c-lang-const c-get-state-before-change-functions)))
- (if (listp fs)
- fs
- (list fs)))
- "If non-nil, a list of functions called from c-before-change-hook.
- Typically these will record enough state to allow
- `c-before-font-lock-function' to extend the region to fontify,
- and may do such things as removing text-properties which must be
- recalculated.
- These functions will be run in the order given. Each of them
- takes 2 parameters, the BEG and END supplied to every
- before-change function; on entry, the buffer will have been
- widened and match-data will have been saved; point is undefined
- on both entry and exit; the return value is ignored.
- The functions are called even when font locking isn't enabled.
- When the mode is initialized, the functions are called with
- parameters \(point-min) and \(point-max).")
- (c-lang-defconst c-before-font-lock-functions
-
-
- t 'c-change-set-fl-decl-start
- (c c++ objc) '(c-neutralize-syntax-in-and-mark-CPP
- c-change-set-fl-decl-start)
- awk 'c-awk-extend-and-syntax-tablify-region)
- (c-lang-defvar c-before-font-lock-functions
- (let ((fs (c-lang-const c-before-font-lock-functions)))
- (if (listp fs)
- fs
- (list fs)))
- "If non-nil, a list of functions called just before font locking.
- Typically they will extend the region about to be fontified \(see
- below) and will set `syntax-table' text properties on the region.
- These functions will be run in the order given. Each of them
- takes 3 parameters, the BEG, END, and OLD-LEN supplied to every
- after-change function; point is undefined on both entry and exit;
- on entry, the buffer will have been widened and match-data will
- have been saved; the return value is ignored.
- The functions may extend the region to be fontified by setting the
- buffer local variables c-new-BEG and c-new-END.
- The functions are called even when font locking is disabled.
- When the mode is initialized, these functions are called with
- parameters \(point-min), \(point-max) and <buffer size>.")
- (c-lang-defconst c-before-context-fontification-functions
- awk nil
- t 'c-context-set-fl-decl-start)
-
-
- (c-lang-defvar c-before-context-fontification-functions
- (let ((fs (c-lang-const c-before-context-fontification-functions)))
- (if (listp fs)
- fs
- (list fs)))
- "If non-nil, a list of functions called just before context (or
- other non-change) fontification is done. Typically they will
- extend the region.
- These functions will be run in the order given. Each of them
- takes 2 parameters, the BEG and END of the region to be
- fontified. Point is undefined on both entry and exit. On entry,
- the buffer will have been widened and match-data will have been
- saved; the return value is a cons of the adjusted
- region, (NEW-BEG . NEW-END).")
- (c-lang-defconst c-at-vsemi-p-fn
- "Contains a function \"Is there a virtual semicolon at POS or point?\".
- Such a function takes one optional parameter, a buffer position (defaults to
- point), and returns nil or t. This variable contains nil for languages which
- don't have EOL terminated statements. "
- t nil
- (c c++ objc) 'c-at-macro-vsemi-p
- awk 'c-awk-at-vsemi-p)
- (c-lang-defvar c-at-vsemi-p-fn (c-lang-const c-at-vsemi-p-fn))
- (c-lang-defconst c-vsemi-status-unknown-p-fn
- "Contains a function \"are we unsure whether there is a virtual semicolon on this line?\".
- The (admittedly kludgy) purpose of such a function is to prevent an infinite
- recursion in c-beginning-of-statement-1 when point starts at a `while' token.
- The function MUST NOT UNDER ANY CIRCUMSTANCES call c-beginning-of-statement-1,
- even indirectly. This variable contains nil for languages which don't have
- EOL terminated statements."
- t nil
- (c c++ objc) 'c-macro-vsemi-status-unknown-p
- awk 'c-awk-vsemi-status-unknown-p)
- (c-lang-defvar c-vsemi-status-unknown-p-fn
- (c-lang-const c-vsemi-status-unknown-p-fn))
- (c-lang-defconst c-has-bitfields
- "Whether the language has bitfield declarations."
- t nil
- (c c++ objc) t)
- (c-lang-defvar c-has-bitfields (c-lang-const c-has-bitfields))
- (c-lang-defconst c-symbol-start
- "Regexp that matches the start of a symbol, i.e. any identifier or
- keyword. It's unspecified how far it matches. Does not contain a \\|
- operator at the top level."
- t (concat "[" c-alpha "_]")
- java (concat "[" c-alpha "_@]")
- objc (concat "[" c-alpha "_@]")
- pike (concat "[" c-alpha "_`]"))
- (c-lang-defvar c-symbol-start (c-lang-const c-symbol-start))
- (c-lang-defconst c-symbol-chars
- "Set of characters that can be part of a symbol.
- This is of the form that fits inside [ ] in a regexp."
-
-
- t (concat c-alnum "_$")
- objc (concat c-alnum "_$@"))
- (c-lang-defvar c-symbol-chars (c-lang-const c-symbol-chars))
- (c-lang-defconst c-symbol-key
- "Regexp matching identifiers and keywords (with submatch 0). Assumed
- to match if `c-symbol-start' matches on the same position."
- t (concat (c-lang-const c-symbol-start)
- "[" (c-lang-const c-symbol-chars) "]*")
- pike (concat
-
-
- (c-lang-const c-symbol-key c)
- "\\|"
- (c-make-keywords-re nil
- (c-lang-const c-overloadable-operators))))
- (c-lang-defvar c-symbol-key (c-lang-const c-symbol-key))
- (c-lang-defconst c-symbol-key-depth
-
- t (regexp-opt-depth (c-lang-const c-symbol-key)))
- (c-lang-defconst c-nonsymbol-chars
- "This is the set of chars that can't be part of a symbol, i.e. the
- negation of `c-symbol-chars'."
- t (concat "^" (c-lang-const c-symbol-chars)))
- (c-lang-defvar c-nonsymbol-chars (c-lang-const c-nonsymbol-chars))
- (c-lang-defconst c-nonsymbol-key
- "Regexp that matches any character that can't be part of a symbol.
- It's usually appended to other regexps to avoid matching a prefix.
- It's assumed to not contain any submatchers."
-
-
- t (concat "[" (c-lang-const c-nonsymbol-chars) "]"))
- (c-lang-defconst c-identifier-ops
- "The operators that make up fully qualified identifiers. nil in
- languages that don't have such things. See `c-operators' for a
- description of the format. Binary operators can concatenate symbols,
- e.g. \"::\" in \"A::B::C\". Prefix operators can precede identifiers,
- e.g. \"~\" in \"~A::B\". Other types of operators aren't supported.
- This value is by default merged into `c-operators'."
- t nil
- c++ '((prefix "~" "??-" "compl")
- (right-assoc "::")
- (prefix "::"))
-
-
-
-
-
-
- java '((left-assoc "."))
- idl '((left-assoc "::")
- (prefix "::"))
- pike '((left-assoc "::")
- (prefix "::")
- (left-assoc ".")))
- (c-lang-defconst c-opt-identifier-concat-key
-
-
-
-
-
-
- t (let ((ops (c-filter-ops (c-lang-const c-identifier-ops)
- '(left-assoc right-assoc)
- t)))
- (when ops
- (c-make-keywords-re 'appendable ops))))
- (c-lang-defvar c-opt-identifier-concat-key
- (c-lang-const c-opt-identifier-concat-key)
- 'dont-doc)
- (c-lang-defconst c-opt-identifier-concat-key-depth
-
- t (regexp-opt-depth (c-lang-const c-opt-identifier-concat-key)))
- (c-lang-defconst c-opt-identifier-prefix-key
-
-
-
- t (let ((ops (c-filter-ops (c-lang-const c-identifier-ops)
- '(prefix)
- t)))
- (when ops
- (c-make-keywords-re 'appendable ops))))
- (c-lang-defconst c-after-id-concat-ops
- "Operators that can occur after a binary operator on `c-identifier-ops'
- in identifiers. nil in languages that don't have such things.
- Operators here should also have appropriate entries in `c-operators' -
- it's not taken care of by default."
- t nil
-
- c++ '("~" "*")
-
-
-
- java '("*"))
- (c-lang-defconst c-opt-after-id-concat-key
-
-
-
-
-
-
-
-
- t (concat (c-lang-const c-symbol-start)
- (if (c-lang-const c-after-id-concat-ops)
- (concat "\\|" (c-make-keywords-re 'appendable
- (c-lang-const c-after-id-concat-ops)))
- "")))
- (c-lang-defconst c-identifier-start
- "Regexp that matches the start of an (optionally qualified) identifier.
- It should also match all keywords. It's unspecified how far it
- matches."
- t (concat (c-lang-const c-symbol-start)
- (if (c-lang-const c-opt-identifier-prefix-key)
- (concat "\\|"
- (c-lang-const c-opt-identifier-prefix-key))
- "")))
- (c-lang-defvar c-identifier-start (c-lang-const c-identifier-start))
- (c-lang-defconst c-identifier-key
- "Regexp matching a fully qualified identifier, like \"A::B::c\" in
- C++. It does not recognize the full range of syntactic whitespace
- between the tokens; `c-forward-name' has to be used for that. It
- should also not match identifiers containing parenthesis groupings,
- e.g. identifiers with template arguments such as \"A<X,Y>\" in C++."
-
-
- t (concat (if (c-lang-const c-opt-identifier-prefix-key)
- (concat
- "\\("
- (c-lang-const c-opt-identifier-prefix-key)
- (c-lang-const c-simple-ws) "*"
- "\\)?")
- "")
- "\\(" (c-lang-const c-symbol-key) "\\)"
- (if (c-lang-const c-opt-identifier-concat-key)
- (concat
- "\\("
- (c-lang-const c-simple-ws) "*"
- (c-lang-const c-opt-identifier-concat-key)
- (c-lang-const c-simple-ws) "*"
- (if (c-lang-const c-after-id-concat-ops)
- (concat
- "\\("
- (c-make-keywords-re 'appendable
- (c-lang-const c-after-id-concat-ops))
- (concat
-
-
-
-
-
- "\\("
- (c-lang-const c-simple-ws) "*"
- "\\(" (c-lang-const c-symbol-key) "\\)"
- "\\)?")
- "\\|"
- "\\(" (c-lang-const c-symbol-key) "\\)"
- "\\)")
- (concat "\\(" (c-lang-const c-symbol-key) "\\)"))
- "\\)*")
- "")))
- (c-lang-defvar c-identifier-key (c-lang-const c-identifier-key))
- (c-lang-defconst c-identifier-last-sym-match
-
-
-
-
-
-
-
-
- t nil)
- (c-lang-defconst c-string-escaped-newlines
- "Set if the language support backslash escaped newlines inside string
- literals."
- t nil
- (c c++ objc pike) t)
- (c-lang-defvar c-string-escaped-newlines
- (c-lang-const c-string-escaped-newlines))
- (c-lang-defconst c-multiline-string-start-char
- "Set if the language supports multiline string literals without escaped
- newlines. If t, all string literals are multiline. If a character,
- only literals where the open quote is immediately preceded by that
- literal are multiline."
- t nil
- pike ?#)
- (c-lang-defvar c-multiline-string-start-char
- (c-lang-const c-multiline-string-start-char))
- (c-lang-defconst c-opt-cpp-symbol
- "The symbol which starts preprocessor constructs when in the margin."
- t "#"
- (java awk) nil)
- (c-lang-defvar c-opt-cpp-symbol (c-lang-const c-opt-cpp-symbol))
- (c-lang-defconst c-opt-cpp-prefix
- "Regexp matching the prefix of a cpp directive in the languages that
- normally use that macro preprocessor. Tested at bol or at boi.
- Assumed to not contain any submatches or \\| operators."
-
-
- t "\\s *#\\s *"
- (java awk) nil)
- (c-lang-defvar c-opt-cpp-prefix (c-lang-const c-opt-cpp-prefix))
- (c-lang-defconst c-anchored-cpp-prefix
- "Regexp matching the prefix of a cpp directive anchored to BOL,
- in the languages that have a macro preprocessor."
- t (if (c-lang-const c-opt-cpp-prefix)
- (concat "^" (c-lang-const c-opt-cpp-prefix))))
- (c-lang-defvar c-anchored-cpp-prefix (c-lang-const c-anchored-cpp-prefix))
- (c-lang-defconst c-opt-cpp-start
- "Regexp matching the prefix of a cpp directive including the directive
- name, or nil in languages without preprocessor support. The first
- submatch surrounds the directive name."
- t (if (c-lang-const c-opt-cpp-prefix)
- (concat (c-lang-const c-opt-cpp-prefix)
- "\\([" c-alnum "]+\\)"))
-
- pike (concat (c-lang-const c-opt-cpp-prefix)
- "\\([" c-alnum "]+\\|!\\)"))
- (c-lang-defvar c-opt-cpp-start (c-lang-const c-opt-cpp-start))
- (c-lang-defconst c-cpp-message-directives
- "List of cpp directives (without the prefix) that are followed by a
- string message."
- t (if (c-lang-const c-opt-cpp-prefix)
- '("error"))
- (c c++ objc pike) '("error" "warning"))
- (c-lang-defconst c-cpp-include-directives
- "List of cpp directives (without the prefix) that are followed by a
- file name in angle brackets or quotes."
- t (if (c-lang-const c-opt-cpp-prefix)
- '("include"))
- objc '("include" "import"))
- (c-lang-defconst c-opt-cpp-macro-define
- "Cpp directive (without the prefix) that is followed by a macro
- definition, or nil if the language doesn't have any."
- t (if (c-lang-const c-opt-cpp-prefix)
- "define"))
- (c-lang-defvar c-opt-cpp-macro-define
- (c-lang-const c-opt-cpp-macro-define))
- (c-lang-defconst c-opt-cpp-macro-define-start
-
-
-
- t (if (c-lang-const c-opt-cpp-macro-define)
- (concat (c-lang-const c-opt-cpp-prefix)
- (c-lang-const c-opt-cpp-macro-define)
- "[ \t]+\\(\\(\\sw\\|_\\)+\\)\\(\([^\)]*\)\\)?"
-
- "\\([ \t]\\|\\\\\n\\)*")))
- (c-lang-defvar c-opt-cpp-macro-define-start
- (c-lang-const c-opt-cpp-macro-define-start))
- (c-lang-defconst c-opt-cpp-macro-define-id
-
-
- t (if (c-lang-const c-opt-cpp-macro-define)
- (concat (c-lang-const c-opt-cpp-prefix)
- (c-lang-const c-opt-cpp-macro-define)
- "[ \t]+\\(\\sw\\|_\\)+")))
- (c-lang-defvar c-opt-cpp-macro-define-id
- (c-lang-const c-opt-cpp-macro-define-id))
- (c-lang-defconst c-cpp-expr-directives
- "List of cpp directives (without the prefix) that are followed by an
- expression."
- t (if (c-lang-const c-opt-cpp-prefix)
- '("if" "elif")))
- (c-lang-defconst c-cpp-expr-intro-re
- "Regexp which matches the start of a CPP directive which contains an
- expression, or nil if there aren't any in the language."
- t (if (c-lang-const c-cpp-expr-directives)
- (concat
- (c-lang-const c-opt-cpp-prefix)
- (c-make-keywords-re t (c-lang-const c-cpp-expr-directives)))))
- (c-lang-defvar c-cpp-expr-intro-re
- (c-lang-const c-cpp-expr-intro-re))
- (c-lang-defconst c-cpp-expr-functions
- "List of functions in cpp expressions."
- t (if (c-lang-const c-opt-cpp-prefix)
- '("defined"))
- pike '("defined" "efun" "constant"))
- (c-lang-defconst c-assignment-operators
- "List of all assignment operators."
- t '("=" "*=" "/=" "%=" "+=" "-=" ">>=" "<<=" "&=" "^=" "|=")
- java (append (c-lang-const c-assignment-operators)
- '(">>>="))
- c++ (append (c-lang-const c-assignment-operators)
- '("and_eq" "or_eq" "xor_eq" "??!=" "??'="))
- idl nil)
- (c-lang-defconst c-operators
- "List describing all operators, along with their precedence and
- associativity. The order in the list corresponds to the precedence of
- the operators: The operators in each element are a group with the same
- precedence, and the group has higher precedence than the groups in all
- following elements. The car of each element describes the type of the
- operator group, and the cdr is a list of the operator tokens in it.
- The operator group types are:
- 'prefix Unary prefix operators.
- 'postfix Unary postfix operators.
- 'postfix-if-paren
- Unary postfix operators if and only if the chars have
- parenthesis syntax.
- 'left-assoc Binary left associative operators (i.e. a+b+c means (a+b)+c).
- 'right-assoc Binary right associative operators (i.e. a=b=c means a=(b=c)).
- 'right-assoc-sequence
- Right associative operator that constitutes of a
- sequence of tokens that separate expressions. All the
- tokens in the group are in this case taken as
- describing the sequence in one such operator, and the
- order between them is therefore significant.
- Operators containing a character with paren syntax are taken to match
- with a corresponding open/close paren somewhere else. A postfix
- operator with close paren syntax is taken to end a postfix expression
- started somewhere earlier, rather than start a new one at point. Vice
- versa for prefix operators with open paren syntax.
- Note that operators like \".\" and \"->\" which in language references
- often are described as postfix operators are considered binary here,
- since CC Mode treats every identifier as an expression."
-
-
-
- t `(
- ,@(when (c-lang-const c-opt-cpp-prefix)
- `((prefix "#"
- ,@(when (c-major-mode-is '(c-mode c++-mode))
- '("%:" "??=")))
- (left-assoc "##"
- ,@(when (c-major-mode-is '(c-mode c++-mode))
- '("%:%:" "??=??=")))))
-
- ,@(c-lang-const c-identifier-ops)
- ,@(cond ((or (c-major-mode-is 'c++-mode) (c-major-mode-is 'java-mode))
- `((postfix-if-paren "<" ">")))
- ((c-major-mode-is 'pike-mode)
- `((prefix "global" "predef")))
- ((c-major-mode-is 'java-mode)
- `((prefix "super"))))
-
- ,@(when (c-major-mode-is 'c++-mode)
-
- `((prefix "dynamic_cast" "static_cast"
- "reinterpret_cast" "const_cast" "typeid")))
- (left-assoc "."
- ,@(unless (c-major-mode-is 'java-mode)
- '("->")))
- (postfix "++" "--" "[" "]" "(" ")"
- ,@(when (c-major-mode-is '(c-mode c++-mode))
- '("<:" ":>" "??(" "??)")))
-
- (prefix "++" "--" "+" "-" "!" "~"
- ,@(when (c-major-mode-is 'c++-mode) '("not" "compl"))
- ,@(when (c-major-mode-is '(c-mode c++-mode))
- '("*" "&" "sizeof" "??-"))
- ,@(when (c-major-mode-is 'objc-mode)
- '("@selector" "@protocol" "@encode"))
-
- ,@(cond ((c-major-mode-is 'c++-mode)
- '("new" "delete"))
- ((c-major-mode-is 'java-mode)
- '("new"))
- ((c-major-mode-is 'pike-mode)
- '("class" "lambda" "catch" "throw" "gauge")))
- "(" ")"
- ,@(when (c-major-mode-is 'pike-mode)
- '("[" "]")))
-
- ,@(when (c-major-mode-is 'c++-mode)
- `((left-assoc ".*" "->*")))
-
- (left-assoc "*" "/" "%")
-
- (left-assoc "+" "-")
-
- (left-assoc "<<" ">>"
- ,@(when (c-major-mode-is 'java-mode)
- '(">>>")))
-
- (left-assoc "<" ">" "<=" ">="
- ,@(when (c-major-mode-is 'java-mode)
- '("instanceof")))
-
- (left-assoc "==" "!="
- ,@(when (c-major-mode-is 'c++-mode) '("not_eq")))
-
- (left-assoc "&"
- ,@(when (c-major-mode-is 'c++-mode) '("bitand")))
-
- (left-assoc "^"
- ,@(when (c-major-mode-is '(c-mode c++-mode))
- '("??'"))
- ,@(when (c-major-mode-is 'c++-mode) '("xor")))
-
- (left-assoc "|"
- ,@(when (c-major-mode-is '(c-mode c++-mode))
- '("??!"))
- ,@(when (c-major-mode-is 'c++-mode) '("bitor")))
-
- (left-assoc "&&"
- ,@(when (c-major-mode-is 'c++-mode) '("and")))
-
- (left-assoc "||"
- ,@(when (c-major-mode-is '(c-mode c++-mode))
- '("??!??!"))
- ,@(when (c-major-mode-is 'c++-mode) '("or")))
-
- (right-assoc-sequence "?" ":")
-
- (right-assoc ,@(c-lang-const c-assignment-operators))
-
- ,@(when (c-major-mode-is 'c++-mode)
- '((prefix "throw")))
-
- (left-assoc ","))
-
-
- idl `(
- (prefix "#")
- (left-assoc "##")
-
- ,@(c-lang-const c-identifier-ops)
-
- (prefix "+" "-" "~")
-
- (left-assoc "*" "/" "%")
-
- (left-assoc "+" "-")
-
- (left-assoc "<<" ">>")
-
- (left-assoc "&")
-
- (left-assoc "^")
-
- (left-assoc "|")))
- (c-lang-defconst c-operator-list
-
- t (c-filter-ops (c-lang-const c-operators) t t))
- (c-lang-defconst c-overloadable-operators
- "List of the operators that are overloadable, in their \"identifier
- form\". See also `c-op-identifier-prefix'."
- t nil
- c++ '("new" "delete"
- "+" "-" "*" "/" "%"
- "^" "??'" "xor" "&" "bitand" "|" "??!" "bitor" "~" "??-" "compl"
- "!" "=" "<" ">" "+=" "-=" "*=" "/=" "%=" "^="
- "??'=" "xor_eq" "&=" "and_eq" "|=" "??!=" "or_eq"
- "<<" ">>" ">>=" "<<=" "==" "!=" "not_eq" "<=" ">="
- "&&" "and" "||" "??!??!" "or" "++" "--" "," "->*" "->"
- "()" "[]" "<::>" "??(??)")
-
- pike '("`+" "`-" "`&" "`|" "`^" "`<<" "`>>" "`*" "`/" "`%" "`~"
- "`==" "`<" "`>" "`!" "`[]" "`[]=" "`->" "`->=" "`()" "``+"
- "``-" "``&" "``|" "``^" "``<<" "``>>" "``*" "``/" "``%"
- "`+="))
- (c-lang-defconst c-overloadable-operators-regexp
-
- t nil
- c++ (c-make-keywords-re nil (c-lang-const c-overloadable-operators)))
- (c-lang-defvar c-overloadable-operators-regexp
- (c-lang-const c-overloadable-operators-regexp))
- (c-lang-defconst c-opt-op-identifier-prefix
- "Regexp matching the token before the ones in
- `c-overloadable-operators' when operators are specified in their
- \"identifier form\". This typically matches \"operator\" in C++ where
- operator functions are specified as e.g. \"operator +\". It's nil in
- languages without operator functions or where the complete operator
- identifier is listed in `c-overloadable-operators'.
- This regexp is assumed to not match any non-operator identifier."
- t nil
- c++ (c-make-keywords-re t '("operator")))
- (c-lang-defvar c-opt-op-identifier-prefix
- (c-lang-const c-opt-op-identifier-prefix))
- (defvaralias 'c-opt-op-identitier-prefix 'c-opt-op-identifier-prefix)
- (make-obsolete-variable 'c-opt-op-identitier-prefix 'c-opt-op-identifier-prefix
- "CC Mode 5.31.4, 2006-04-14")
- (c-lang-defconst c-other-op-syntax-tokens
- "List of the tokens made up of characters in the punctuation or
- parenthesis syntax classes that have uses other than as expression
- operators."
- t '("{" "}" "(" ")" "[" "]" ";" ":" "," "=" "/*" "*/" "//")
- (c c++ pike) (append '("#" "##"
- "::" "...")
- (c-lang-const c-other-op-syntax-tokens))
- (c c++) (append '("*") (c-lang-const c-other-op-syntax-tokens))
- c++ (append '("&" "<%" "%>" "<:" ":>" "%:" "%:%:")
- (c-lang-const c-other-op-syntax-tokens))
- objc (append '("#" "##"
- "+" "-") (c-lang-const c-other-op-syntax-tokens))
- idl (append '("#" "##")
- (c-lang-const c-other-op-syntax-tokens))
- pike (append '("..")
- (c-lang-const c-other-op-syntax-tokens)
- (c-lang-const c-overloadable-operators))
- awk '("{" "}" "(" ")" "[" "]" ";" "," "=" "/"))
- (c-lang-defconst c-all-op-syntax-tokens
-
-
- t (delete-duplicates (append (c-lang-const c-other-op-syntax-tokens)
- (c-lang-const c-operator-list))
- :test 'string-equal))
- (c-lang-defconst c-nonsymbol-token-char-list
-
-
-
- t (c-with-syntax-table (c-lang-const c-mode-syntax-table)
-
-
- (let (list (char 32))
- (while (< char 127)
- (or (memq (char-syntax char) '(?w ?_ ?< ?> ?\ ))
- (setq list (cons (c-int-to-char char) list)))
- (setq char (1+ char)))
- list)))
- (c-lang-defconst c-nonsymbol-token-regexp
-
-
-
- t (c-make-keywords-re nil
- (c-filter-ops (c-lang-const c-all-op-syntax-tokens)
- t
- "\\`\\(\\s.\\|\\s\(\\|\\s\)\\)+\\'")))
- (c-lang-defvar c-nonsymbol-token-regexp
- (c-lang-const c-nonsymbol-token-regexp))
- (c-lang-defconst c-assignment-op-regexp
-
-
-
- t (if (c-lang-const c-assignment-operators)
- (concat
-
- "=\\([^=]\\|$\\)"
- "\\|"
- (c-make-keywords-re nil
- (set-difference (c-lang-const c-assignment-operators)
- '("=")
- :test 'string-equal)))
- "\\<\\>"))
- (c-lang-defvar c-assignment-op-regexp
- (c-lang-const c-assignment-op-regexp))
- (c-lang-defconst c-<>-multichar-token-regexp
-
-
- t (c-make-keywords-re nil
- (c-filter-ops (c-lang-const c-all-op-syntax-tokens)
- t
- ".[<>]\\|[<>].")))
- (c-lang-defvar c-<>-multichar-token-regexp
- (c-lang-const c-<>-multichar-token-regexp))
- (c-lang-defconst c-<-op-cont-regexp
-
-
- t (c-make-keywords-re nil
- (c-filter-ops (c-lang-const c-all-op-syntax-tokens)
- t
- "\\`<."
- (lambda (op) (substring op 1)))))
- (c-lang-defvar c-<-op-cont-regexp (c-lang-const c-<-op-cont-regexp))
- (c-lang-defconst c->-op-cont-regexp
-
-
- t (c-make-keywords-re nil
- (c-filter-ops (c-lang-const c-all-op-syntax-tokens)
- t
- "\\`>."
- (lambda (op) (substring op 1))))
- java (c-make-keywords-re nil
- (c-filter-ops (c-lang-const c-all-op-syntax-tokens)
- t
- "\\`>[^>]\\|\\`>>[^>]"
- (lambda (op) (substring op 1)))))
- (c-lang-defvar c->-op-cont-regexp (c-lang-const c->-op-cont-regexp))
- (c-lang-defconst c-stmt-delim-chars
-
-
-
-
- t "^;{}?:")
- (c-lang-defvar c-stmt-delim-chars (c-lang-const c-stmt-delim-chars))
- (c-lang-defconst c-stmt-delim-chars-with-comma
-
- t "^;,{}?:")
- (c-lang-defvar c-stmt-delim-chars-with-comma
- (c-lang-const c-stmt-delim-chars-with-comma))
- (c-lang-defconst c-simple-ws
- "Regexp matching an ordinary whitespace character.
- Does not contain a \\| operator at the top level."
-
- t "\\(\\s \\|[\n\r]\\)")
- (c-lang-defconst c-simple-ws-depth
-
- t (regexp-opt-depth (c-lang-const c-simple-ws)))
- (c-lang-defconst c-line-comment-starter
- "String that starts line comments, or nil if such don't exist.
- Line comments are always terminated by newlines. At least one of
- `c-block-comment-starter' and this one is assumed to be set.
- Note that it's currently not enough to set this to support a new
- comment style. Other stuff like the syntax table must also be set up
- properly."
- t "//"
- awk "#")
- (c-lang-defvar c-line-comment-starter (c-lang-const c-line-comment-starter))
- (c-lang-defconst c-block-comment-starter
- "String that starts block comments, or nil if such don't exist.
- Block comments are ended by `c-block-comment-ender', which is assumed
- to be set if this is. At least one of `c-line-comment-starter' and
- this one is assumed to be set.
- Note that it's currently not enough to set this to support a new
- comment style. Other stuff like the syntax table must also be set up
- properly."
- t "/*"
- awk nil)
- (c-lang-defconst c-block-comment-ender
- "String that ends block comments, or nil if such don't exist.
- Note that it's currently not enough to set this to support a new
- comment style. Other stuff like the syntax table must also be set up
- properly."
- t "*/"
- awk nil)
- (c-lang-defconst c-comment-start-regexp
-
- t (let ((re (c-make-keywords-re nil
- (list (c-lang-const c-line-comment-starter)
- (c-lang-const c-block-comment-starter)))))
- (if (memq 'gen-comment-delim c-emacs-features)
- (concat re "\\|\\s!")
- re)))
- (c-lang-defvar c-comment-start-regexp (c-lang-const c-comment-start-regexp))
- (c-lang-defconst c-block-comment-start-regexp
-
-
- t (if (c-lang-const c-block-comment-starter)
- (regexp-quote (c-lang-const c-block-comment-starter))
- "\\<\\>"))
- (c-lang-defvar c-block-comment-start-regexp
- (c-lang-const c-block-comment-start-regexp))
- (c-lang-defconst c-line-comment-start-regexp
-
-
- t (if (c-lang-const c-line-comment-starter)
- (regexp-quote (c-lang-const c-line-comment-starter))
- "\\<\\>"))
- (c-lang-defvar c-line-comment-start-regexp
- (c-lang-const c-line-comment-start-regexp))
- (c-lang-defconst c-literal-start-regexp
-
- t (concat (c-lang-const c-comment-start-regexp)
- "\\|"
- (if (memq 'gen-string-delim c-emacs-features)
- "\"|"
- "\"")))
- (c-lang-defvar c-literal-start-regexp (c-lang-const c-literal-start-regexp))
- (c-lang-defconst c-doc-comment-start-regexp
- "Regexp to match the start of documentation comments."
- t "\\<\\>"
-
- (c c++ objc) "/\\*[*!]"
- java "/\\*\\*"
- pike "/[/*]!")
- (c-lang-defvar c-doc-comment-start-regexp
- (c-lang-const c-doc-comment-start-regexp))
- (c-lang-defconst comment-start
- "String that starts comments inserted with M-; etc.
- `comment-start' is initialized from this."
-
- t (concat (or (c-lang-const c-line-comment-starter)
- (c-lang-const c-block-comment-starter))
- " ")
-
-
- c "/* ")
- (c-lang-setvar comment-start (c-lang-const comment-start))
- (c-lang-defconst comment-end
- "String that ends comments inserted with M-; etc.
- `comment-end' is initialized from this."
-
-
- t (if (string-match (concat "\\`\\("
- (c-lang-const c-block-comment-start-regexp)
- "\\)")
- (c-lang-const comment-start))
- (concat " " (c-lang-const c-block-comment-ender))
- ""))
- (c-lang-setvar comment-end (c-lang-const comment-end))
- (c-lang-defconst comment-start-skip
- "Regexp to match the start of a comment plus everything up to its body.
- `comment-start-skip' is initialized from this."
-
-
- t (concat "\\("
- (c-concat-separated
- (mapcar (lambda (cs)
- (when cs
- (concat (regexp-quote cs) "+")))
- (list (c-lang-const c-line-comment-starter)
- (c-lang-const c-block-comment-starter)))
- "\\|")
- "\\)\\s *"))
- (c-lang-setvar comment-start-skip (c-lang-const comment-start-skip))
- (c-lang-defconst c-syntactic-ws-start
-
-
- t (concat "\\s \\|"
- (c-make-keywords-re nil
- (append (list (c-lang-const c-line-comment-starter)
- (c-lang-const c-block-comment-starter)
- (when (c-lang-const c-opt-cpp-prefix)
- "#"))
- '("\n" "\r")))
- "\\|\\\\[\n\r]"
- (when (memq 'gen-comment-delim c-emacs-features)
- "\\|\\s!")))
- (c-lang-defvar c-syntactic-ws-start (c-lang-const c-syntactic-ws-start))
- (c-lang-defconst c-syntactic-ws-end
-
- t (concat "\\s \\|"
- (c-make-keywords-re nil
- (append (when (c-lang-const c-block-comment-ender)
- (list
- (string
- (elt (c-lang-const c-block-comment-ender)
- (1- (length
- (c-lang-const c-block-comment-ender)))))))
- '("\n" "\r")))
- (when (memq 'gen-comment-delim c-emacs-features)
- "\\|\\s!")))
- (c-lang-defvar c-syntactic-ws-end (c-lang-const c-syntactic-ws-end))
- (c-lang-defconst c-unterminated-block-comment-regexp
-
-
-
- t (when (c-lang-const c-block-comment-starter)
- (concat
- (regexp-quote (c-lang-const c-block-comment-starter))
-
-
- (let ((end (c-lang-const c-block-comment-ender)))
- (cond ((= (length end) 1)
- (concat "[^" end "\n\r]*"))
- ((= (length end) 2)
- (concat "[^" (substring end 0 1) "\n\r]*"
- "\\("
- (regexp-quote (substring end 0 1)) "+"
- "[^"
-
- (cond ((= (elt end 0) (elt end 1))
- (concat (substring end 0 1) "\n\r"))
- ((= (elt end 1) ?\])
- (concat (substring end 1 2) "\n\r"
- (substring end 0 1)))
- (t
- (concat (substring end 0 1) "\n\r"
- (substring end 1 2))))
- "]"
- "[^" (substring end 0 1) "\n\r]*"
- "\\)*"))
- (t
- (error "Can't handle a block comment ender of length %s"
- (length end))))))))
- (c-lang-defconst c-block-comment-regexp
-
-
-
-
-
-
-
- t (when (c-lang-const c-unterminated-block-comment-regexp)
- (concat
- (c-lang-const c-unterminated-block-comment-regexp)
- (let ((end (c-lang-const c-block-comment-ender)))
- (cond ((= (length end) 1)
- (regexp-quote end))
- ((= (length end) 2)
- (concat (regexp-quote (substring end 0 1)) "+"
- (regexp-quote (substring end 1 2))))
- (t
- (error "Can't handle a block comment ender of length %s"
- (length end))))))))
- (c-lang-defconst c-nonwhite-syntactic-ws
-
-
-
-
- t (c-concat-separated
- (list (when (c-lang-const c-line-comment-starter)
- (concat (regexp-quote (c-lang-const c-line-comment-starter))
- "[^\n\r]*[\n\r]"))
- (c-lang-const c-block-comment-regexp)
- "\\\\[\n\r]"
- (when (memq 'gen-comment-delim c-emacs-features)
- "\\s!\\S!*\\s!"))
- "\\|"))
- (c-lang-defconst c-syntactic-ws
-
-
-
-
- t (concat (c-lang-const c-simple-ws) "*"
- "\\("
- (concat "\\(" (c-lang-const c-nonwhite-syntactic-ws) "\\)"
- (c-lang-const c-simple-ws) "*")
- "\\)*"))
- (c-lang-defconst c-syntactic-ws-depth
-
- t (regexp-opt-depth (c-lang-const c-syntactic-ws)))
- (c-lang-defconst c-nonempty-syntactic-ws
-
-
-
-
- t (concat "\\("
- (c-lang-const c-simple-ws)
- "\\|"
- (c-lang-const c-nonwhite-syntactic-ws)
- "\\)+"))
- (c-lang-defconst c-nonempty-syntactic-ws-depth
-
- t (regexp-opt-depth (c-lang-const c-nonempty-syntactic-ws)))
- (c-lang-defconst c-single-line-syntactic-ws
-
-
-
-
- t (if (c-lang-const c-block-comment-regexp)
- (concat "\\s *\\("
- (c-lang-const c-block-comment-regexp)
- "\\s *\\)*")
- "\\s *"))
- (c-lang-defconst c-single-line-syntactic-ws-depth
-
- t (regexp-opt-depth (c-lang-const c-single-line-syntactic-ws)))
- (c-lang-defconst c-syntactic-eol
-
-
-
- t (concat (c-lang-const c-single-line-syntactic-ws)
-
-
-
-
- "\\("
- (c-concat-separated
- (list (when (c-lang-const c-line-comment-starter)
- (regexp-quote (c-lang-const c-line-comment-starter)))
- (when (c-lang-const c-unterminated-block-comment-regexp)
- (concat (c-lang-const c-unterminated-block-comment-regexp)
- "$"))
- "\\\\$"
- "$")
- "\\|")
- "\\)"))
- (c-lang-defvar c-syntactic-eol (c-lang-const c-syntactic-eol))
- (c-lang-defconst beginning-of-defun-function
- "Function to which beginning-of-defun-function will be set."
- t 'c-beginning-of-defun
- awk 'c-awk-beginning-of-defun)
- (c-lang-setvar beginning-of-defun-function
- (c-lang-const beginning-of-defun-function))
- (c-lang-defconst end-of-defun-function
- "Function to which end-of-defun-function will be set."
- t 'c-end-of-defun
- awk 'c-awk-end-of-defun)
- (c-lang-setvar end-of-defun-function (c-lang-const end-of-defun-function))
- (c-lang-defconst c-paragraph-start
- "Regexp to append to `paragraph-start'."
- t "$"
- java "\\(@[a-zA-Z]+\\>\\|$\\)"
- pike "\\(@[a-zA-Z_-]+\\>\\([^{]\\|$\\)\\|$\\)")
- (c-lang-defvar c-paragraph-start (c-lang-const c-paragraph-start))
- (c-lang-defconst c-paragraph-separate
- "Regexp to append to `paragraph-separate'."
- t "$"
- pike (c-lang-const c-paragraph-start))
- (c-lang-defvar c-paragraph-separate (c-lang-const c-paragraph-separate))
- (c-lang-defconst c-primitive-type-kwds
- "Primitive type keywords. As opposed to the other keyword lists, the
- keywords listed here are fontified with the type face instead of the
- keyword face.
- If any of these also are on `c-type-list-kwds', `c-ref-list-kwds',
- `c-colon-type-list-kwds', `c-paren-nontype-kwds', `c-paren-type-kwds',
- `c-<>-type-kwds', or `c-<>-arglist-kwds' then the associated clauses
- will be handled.
- Do not try to modify this list for end user customizations; the
- `*-font-lock-extra-types' variable, where `*' is the mode prefix, is
- the appropriate place for that."
- t '("char" "double" "float" "int" "long" "short" "signed"
- "unsigned" "void")
- c (append
- '("_Bool" "_Complex" "_Imaginary")
- (c-lang-const c-primitive-type-kwds))
- c++ (append
- '("bool" "wchar_t")
- (c-lang-const c-primitive-type-kwds))
-
- objc (append
- '("id" "Class" "SEL" "IMP" "BOOL")
- (c-lang-const c-primitive-type-kwds))
- java '("boolean" "byte" "char" "double" "float" "int" "long" "short" "void")
- idl '("Object" "ValueBase" "any" "boolean" "char" "double" "fixed" "float"
- "long" "octet" "sequence" "short" "string" "void" "wchar" "wstring"
-
- "ref"
-
-
-
- "unsigned" "strong")
- pike '(
-
- "array" "float" "function" "int" "mapping" "mixed" "multiset"
- "object" "program" "string" "this_program" "void"))
- (c-lang-defconst c-primitive-type-key
-
- t (c-make-keywords-re t (c-lang-const c-primitive-type-kwds)))
- (c-lang-defvar c-primitive-type-key (c-lang-const c-primitive-type-key))
- (c-lang-defconst c-primitive-type-prefix-kwds
- "Keywords that might act as prefixes for primitive types. Assumed to
- be a subset of `c-primitive-type-kwds'."
- t nil
- (c c++) '("long" "short" "signed" "unsigned")
- idl '("long" "unsigned"
-
- "strong"))
- (c-lang-defconst c-typedef-kwds
- "Prefix keyword\(s\) like \"typedef\" which make a type declaration out
- of a variable declaration."
- t '("typedef")
- (awk idl java) nil)
- (c-lang-defconst c-typedef-key
-
- t (c-make-keywords-re t (c-lang-const c-typedef-kwds)))
- (c-lang-defvar c-typedef-key (c-lang-const c-typedef-key))
- (c-lang-defconst c-type-prefix-kwds
- "Keywords where the following name - if any - is a type name, and
- where the keyword together with the symbol works as a type in
- declarations.
- Note that an alternative if the second part doesn't hold is
- `c-type-list-kwds'. Keywords on this list are typically also present
- on one of the `*-decl-kwds' lists."
- t nil
- c '("struct" "union" "enum")
- c++ (append '("class" "typename")
- (c-lang-const c-type-prefix-kwds c)))
- (c-lang-defconst c-type-prefix-key
-
- t (c-make-keywords-re t (c-lang-const c-type-prefix-kwds)))
- (c-lang-defvar c-type-prefix-key (c-lang-const c-type-prefix-key))
- (c-lang-defconst c-type-modifier-kwds
- "Type modifier keywords. These can occur almost anywhere in types
- but they don't build a type of themselves. Unlike the keywords on
- `c-primitive-type-kwds', they are fontified with the keyword face and
- not the type face."
- t nil
- c '("const" "restrict" "volatile")
- c++ '("const" "volatile" "throw")
- objc '("const" "volatile"))
- (c-lang-defconst c-opt-type-modifier-key
-
-
- t (and (c-lang-const c-type-modifier-kwds)
- (c-make-keywords-re t (c-lang-const c-type-modifier-kwds))))
- (c-lang-defvar c-opt-type-modifier-key (c-lang-const c-opt-type-modifier-key))
- (c-lang-defconst c-opt-type-component-key
-
-
- t (and (or (c-lang-const c-primitive-type-prefix-kwds)
- (c-lang-const c-type-modifier-kwds))
- (c-make-keywords-re t
- (append (c-lang-const c-primitive-type-prefix-kwds)
- (c-lang-const c-type-modifier-kwds)))))
- (c-lang-defvar c-opt-type-component-key
- (c-lang-const c-opt-type-component-key))
- (c-lang-defconst c-type-start-kwds
-
-
- t (delete-duplicates (append (c-lang-const c-primitive-type-kwds)
- (c-lang-const c-type-prefix-kwds)
- (c-lang-const c-type-modifier-kwds))
- :test 'string-equal))
- (c-lang-defconst c-class-decl-kwds
- "Keywords introducing declarations where the following block (if any)
- contains another declaration level that should be considered a class.
- If any of these also are on `c-type-list-kwds', `c-ref-list-kwds',
- `c-colon-type-list-kwds', `c-paren-nontype-kwds', `c-paren-type-kwds',
- `c-<>-type-kwds', or `c-<>-arglist-kwds' then the associated clauses
- will be handled.
- Note that presence on this list does not automatically treat the
- following identifier as a type; the keyword must also be present on
- `c-type-prefix-kwds' or `c-type-list-kwds' to accomplish that."
- t nil
- c '("struct" "union")
- c++ '("class" "struct" "union")
- objc '("struct" "union"
- "@interface" "@implementation" "@protocol")
- java '("class" "@interface" "interface")
- idl '("component" "eventtype" "exception" "home" "interface" "struct"
- "union" "valuetype"
-
- "storagehome" "storagetype"
-
- "catalog" "executor" "manages" "segment")
- pike '("class"))
- (c-lang-defconst c-class-key
-
- t (c-make-keywords-re t (c-lang-const c-class-decl-kwds)))
- (c-lang-defvar c-class-key (c-lang-const c-class-key))
- (c-lang-defconst c-brace-list-decl-kwds
- "Keywords introducing declarations where the following block (if
- any) is a brace list.
- If any of these also are on `c-type-list-kwds', `c-ref-list-kwds',
- `c-colon-type-list-kwds', `c-paren-nontype-kwds', `c-paren-type-kwds',
- `c-<>-type-kwds', or `c-<>-arglist-kwds' then the associated clauses
- will be handled."
- t '("enum")
- (awk) nil)
- (c-lang-defconst c-brace-list-key
-
-
- t (c-make-keywords-re t (c-lang-const c-brace-list-decl-kwds)))
- (c-lang-defvar c-brace-list-key (c-lang-const c-brace-list-key))
- (c-lang-defconst c-other-block-decl-kwds
- "Keywords where the following block (if any) contains another
- declaration level that should not be considered a class. For every
- keyword here, CC Mode will add a set of special syntactic symbols for
- those blocks. E.g. if the keyword is \"foo\" then there will be
- `foo-open', `foo-close', and `infoo' symbols.
- The intention is that this category should be used for block
- constructs that aren't related to object orientation concepts like
- classes (which thus also include e.g. interfaces, templates,
- contracts, structs, etc). The more pragmatic distinction is that
- while most want some indentation inside classes, it's fairly common
- that they don't want it in some of these constructs, so it should be
- simple to configure that differently from classes. See also
- `c-class-decl-kwds'.
- If any of these also are on `c-type-list-kwds', `c-ref-list-kwds',
- `c-colon-type-list-kwds', `c-paren-nontype-kwds', `c-paren-type-kwds',
- `c-<>-type-kwds', or `c-<>-arglist-kwds' then the associated clauses
- will be handled."
- t nil
- (c objc) '("extern")
- c++ '("namespace" "extern")
- idl '("module"
-
- "composition"))
- (c-lang-defconst c-other-decl-block-key
-
-
- t (c-make-keywords-re t (c-lang-const c-other-block-decl-kwds)))
- (c-lang-defvar c-other-decl-block-key (c-lang-const c-other-decl-block-key))
- (c-lang-defvar c-other-decl-block-key-in-symbols-alist
- (mapcar
- (lambda (elt)
- (cons elt
- (if (string= elt "extern")
- 'inextern-lang
- (intern (concat "in" elt)))))
- (c-lang-const c-other-block-decl-kwds))
- "Alist associating keywords in c-other-decl-block-decl-kwds with
- their matching \"in\" syntactic symbols.")
- (c-lang-defconst c-typedef-decl-kwds
- "Keywords introducing declarations where the identifier(s) being
- declared are types.
- If any of these also are on `c-type-list-kwds', `c-ref-list-kwds',
- `c-colon-type-list-kwds', `c-paren-nontype-kwds', `c-paren-type-kwds',
- `c-<>-type-kwds', or `c-<>-arglist-kwds' then the associated clauses
- will be handled."
-
-
-
- t (append (c-lang-const c-class-decl-kwds)
- (c-lang-const c-brace-list-decl-kwds))
-
- (c c++ objc idl pike) (append (c-lang-const c-typedef-decl-kwds)
- '("typedef"))
-
-
- idl (delete "exception" (append (c-lang-const c-typedef-decl-kwds) nil)))
- (c-lang-defconst c-typedef-decl-key
- t (c-make-keywords-re t (c-lang-const c-typedef-decl-kwds)))
- (c-lang-defvar c-typedef-decl-key (c-lang-const c-typedef-decl-key))
- (c-lang-defconst c-typeless-decl-kwds
- "Keywords introducing declarations where the \(first) identifier
- \(declarator) follows directly after the keyword, without any type.
- If any of these also are on `c-type-list-kwds', `c-ref-list-kwds',
- `c-colon-type-list-kwds', `c-paren-nontype-kwds', `c-paren-type-kwds',
- `c-<>-type-kwds', or `c-<>-arglist-kwds' then the associated clauses
- will be handled."
-
-
-
- t (append (c-lang-const c-class-decl-kwds)
- (c-lang-const c-brace-list-decl-kwds))
-
-
- idl (append (c-lang-const c-typeless-decl-kwds)
- '("factory" "finder" "native"
-
- "key" "stores"
-
- "facet"))
- pike (append (c-lang-const c-class-decl-kwds)
- '("constant")))
- (c-lang-defconst c-modifier-kwds
- "Keywords that can prefix normal declarations of identifiers
- \(and typically act as flags). Things like argument declarations
- inside function headers are also considered declarations in this
- sense.
- If any of these also are on `c-type-list-kwds', `c-ref-list-kwds',
- `c-colon-type-list-kwds', `c-paren-nontype-kwds', `c-paren-type-kwds',
- `c-<>-type-kwds', or `c-<>-arglist-kwds' then the associated clauses
- will be handled."
- t nil
- (c c++) '("auto" "extern" "inline" "register" "static")
- c++ (append '("explicit" "friend" "mutable" "template" "using" "virtual")
- (c-lang-const c-modifier-kwds))
- objc '("auto" "bycopy" "byref" "extern" "in" "inout" "oneway" "out" "static")
-
- idl '("abstract" "attribute" "const" "consumes" "custom" "emits" "import"
- "in" "inout" "local" "multiple" "oneway" "out" "private" "provides"
- "public" "publishes" "readonly" "typeid" "typeprefix" "uses"
-
- "primary" "state"
-
- "bindsTo" "delegatesTo" "implements" "proxy" "storedOn")
-
- java '("abstract" "const" "final" "native" "private" "protected" "public"
- "static" "strictfp" "synchronized" "transient" "volatile")
- pike '("final" "inline" "local" "nomask" "optional" "private" "protected"
- "public" "static" "variant"))
- (c-lang-defconst c-other-decl-kwds
- "Keywords that can start or prefix any declaration level construct,
- besides those on `c-class-decl-kwds', `c-brace-list-decl-kwds',
- `c-other-block-decl-kwds', `c-typedef-decl-kwds',
- `c-typeless-decl-kwds' and `c-modifier-kwds'.
- If any of these also are on `c-type-list-kwds', `c-ref-list-kwds',
- `c-colon-type-list-kwds', `c-paren-nontype-kwds', `c-paren-type-kwds',
- `c-<>-type-kwds', or `c-<>-arglist-kwds' then the associated clauses
- will be handled."
- t nil
- objc '("@class" "@end" "@defs")
- java '("import" "package")
- pike '("import" "inherit"))
- (c-lang-defconst c-decl-start-kwds
- "Keywords that always start declarations, wherever they occur.
- This can be used for declarations that aren't recognized by the normal
- combination of `c-decl-prefix-re' and `c-decl-start-re'."
- t nil
-
- pike '("class"))
- (c-lang-defconst c-decl-hangon-kwds
- "Keywords that can occur anywhere in a declaration level construct.
- This is used for self-contained things that can be tacked on anywhere
- on a declaration and that should be ignored to be able to recognize it
- correctly. Typical cases are compiler extensions like
- \"__attribute__\" or \"__declspec\":
- __declspec(noreturn) void foo();
- class __declspec(dllexport) classname {...};
- void foo() __attribute__((noreturn));
- Note that unrecognized plain symbols are skipped anyway if they occur
- before the type, so such things are not necessary to mention here.
- Mentioning them here is necessary only if they can occur in other
- places, or if they are followed by a construct that must be skipped
- over \(like the parens in the \"__attribute__\" and \"__declspec\"
- examples above). In the last case, they alse need to be present on
- one of `c-type-list-kwds', `c-ref-list-kwds',
- `c-colon-type-list-kwds', `c-paren-nontype-kwds', `c-paren-type-kwds',
- `c-<>-type-kwds', or `c-<>-arglist-kwds'."
-
-
-
-
-
-
-
-
- t nil
- (c c++) '(
- "__attribute__"
-
- "__declspec"))
- (c-lang-defconst c-decl-hangon-key
-
- t (c-make-keywords-re t (c-lang-const c-decl-hangon-kwds)))
- (c-lang-defvar c-decl-hangon-key (c-lang-const c-decl-hangon-key))
- (c-lang-defconst c-prefix-spec-kwds
-
-
-
-
-
-
- t (delete-duplicates (append (c-lang-const c-class-decl-kwds)
- (c-lang-const c-brace-list-decl-kwds)
- (c-lang-const c-other-block-decl-kwds)
- (c-lang-const c-typedef-decl-kwds)
- (c-lang-const c-typeless-decl-kwds)
- (c-lang-const c-modifier-kwds)
- (c-lang-const c-other-decl-kwds)
- (c-lang-const c-decl-start-kwds)
- (c-lang-const c-decl-hangon-kwds))
- :test 'string-equal))
- (c-lang-defconst c-prefix-spec-kwds-re
-
- t (c-make-keywords-re t (c-lang-const c-prefix-spec-kwds)))
- (c-lang-defvar c-prefix-spec-kwds-re (c-lang-const c-prefix-spec-kwds-re))
- (c-lang-defconst c-specifier-key
-
-
-
- t (c-make-keywords-re t
- (set-difference (c-lang-const c-prefix-spec-kwds)
- (append (c-lang-const c-type-start-kwds)
- (c-lang-const c-<>-arglist-kwds))
- :test 'string-equal)))
- (c-lang-defvar c-specifier-key (c-lang-const c-specifier-key))
- (c-lang-defconst c-postfix-spec-kwds
-
-
- t (append (c-lang-const c-postfix-decl-spec-kwds)
- (c-lang-const c-decl-hangon-kwds)))
- (c-lang-defconst c-not-decl-init-keywords
-
-
- t (c-make-keywords-re t
- (set-difference (c-lang-const c-keywords)
- (append (c-lang-const c-type-start-kwds)
- (c-lang-const c-prefix-spec-kwds))
- :test 'string-equal)))
- (c-lang-defvar c-not-decl-init-keywords
- (c-lang-const c-not-decl-init-keywords))
- (c-lang-defconst c-not-primitive-type-keywords
- "List of all keywords apart from primitive types (like \"int\")."
- t (set-difference (c-lang-const c-keywords)
- (c-lang-const c-primitive-type-kwds)
- :test 'string-equal)
-
-
- c++ (append (c-lang-const c-not-primitive-type-keywords) '("more")))
- (c-lang-defconst c-not-primitive-type-keywords-regexp
- t (c-make-keywords-re t
- (c-lang-const c-not-primitive-type-keywords)))
- (c-lang-defvar c-not-primitive-type-keywords-regexp
- (c-lang-const c-not-primitive-type-keywords-regexp))
- (c-lang-defconst c-protection-kwds
- "Access protection label keywords in classes."
- t nil
- c++ '("private" "protected" "public")
- objc '("@private" "@protected" "@public"))
- (c-lang-defconst c-block-decls-with-vars
- "Keywords introducing declarations that can contain a block which
- might be followed by variable declarations, e.g. like \"foo\" in
- \"class Foo { ... } foo;\". So if there is a block in a declaration
- like that, it ends with the following ';' and not right away.
- The keywords on list are assumed to also be present on one of the
- `*-decl-kwds' lists."
- t nil
- (c objc) '("struct" "union" "enum" "typedef")
- c++ '("class" "struct" "union" "enum" "typedef"))
- (c-lang-defconst c-opt-block-decls-with-vars-key
-
-
- t (and (c-lang-const c-block-decls-with-vars)
- (c-make-keywords-re t (c-lang-const c-block-decls-with-vars))))
- (c-lang-defvar c-opt-block-decls-with-vars-key
- (c-lang-const c-opt-block-decls-with-vars-key))
- (c-lang-defconst c-postfix-decl-spec-kwds
- "Keywords introducing extra declaration specifiers in the region
- between the header and the body \(i.e. the \"K&R-region\") in
- declarations."
- t nil
- java '("extends" "implements" "throws")
- idl '("context" "getraises" "manages" "primarykey" "raises" "setraises"
- "supports"
-
- "as" "const" "implements" "of" "ref"))
- (c-lang-defconst c-nonsymbol-sexp-kwds
- "Keywords that may be followed by a nonsymbol sexp before whatever
- construct it's part of continues."
- t nil
- (c c++ objc) '("extern"))
- (c-lang-defconst c-type-list-kwds
- "Keywords that may be followed by a comma separated list of type
- identifiers, where each optionally can be prefixed by keywords. (Can
- also be used for the special case when the list can contain only one
- element.)
- Assumed to be mutually exclusive with `c-ref-list-kwds'. There's no
- reason to put keywords on this list if they are on `c-type-prefix-kwds'.
- There's also no reason to add keywords that prefixes a normal
- declaration consisting of a type followed by a declarator (list), so
- the keywords on `c-modifier-kwds' should normally not be listed here
- either.
- Note: Use `c-typeless-decl-kwds' for keywords followed by a function
- or variable identifier (that's being defined)."
- t nil
- c++ '("operator")
- objc '("@class")
- java '("import" "new" "extends" "super" "implements" "throws")
- idl '("manages" "native" "primarykey" "supports"
-
- "as" "implements" "of" "scope")
- pike '("inherit"))
- (c-lang-defconst c-ref-list-kwds
- "Keywords that may be followed by a comma separated list of
- reference (i.e. namespace/scope/module) identifiers, where each
- optionally can be prefixed by keywords. (Can also be used for the
- special case when the list can contain only one element.) Assumed to
- be mutually exclusive with `c-type-list-kwds'.
- Note: Use `c-typeless-decl-kwds' for keywords followed by a function
- or variable identifier (that's being defined)."
- t nil
- c++ '("namespace")
- java '("package")
- idl '("import" "module"
-
- "composition")
- pike '("import"))
- (c-lang-defconst c-colon-type-list-kwds
- "Keywords that may be followed (not necessarily directly) by a colon
- and then a comma separated list of type identifiers, where each
- optionally can be prefixed by keywords. (Can also be used for the
- special case when the list can contain only one element.)"
- t nil
- c++ '("class" "struct")
- idl '("component" "eventtype" "home" "interface" "valuetype"
-
- "storagehome" "storagetype"))
- (c-lang-defconst c-colon-type-list-re
- "Regexp matched after the keywords in `c-colon-type-list-kwds' to skip
- forward to the colon. The end of the match is assumed to be directly
- after the colon, so the regexp should end with \":\". Must be a
- regexp if `c-colon-type-list-kwds' isn't nil."
- t (if (c-lang-const c-colon-type-list-kwds)
-
-
-
-
- "[^\]\[{}();,/#=:]*:"))
- (c-lang-defvar c-colon-type-list-re (c-lang-const c-colon-type-list-re))
- (c-lang-defconst c-paren-nontype-kwds
- "Keywords that may be followed by a parenthesis expression that doesn't
- contain type identifiers."
- t nil
- (c c++) '(
- "__attribute__"
-
- "__declspec"))
- (c-lang-defconst c-paren-type-kwds
- "Keywords that may be followed by a parenthesis expression containing
- type identifiers separated by arbitrary tokens."
- t nil
- c++ '("throw")
- objc '("@defs")
- idl '("switch")
- pike '("array" "function" "int" "mapping" "multiset" "object" "program"))
- (c-lang-defconst c-paren-any-kwds
- t (delete-duplicates (append (c-lang-const c-paren-nontype-kwds)
- (c-lang-const c-paren-type-kwds))
- :test 'string-equal))
- (c-lang-defconst c-<>-type-kwds
- "Keywords that may be followed by an angle bracket expression
- containing type identifiers separated by \",\". The difference from
- `c-<>-arglist-kwds' is that unknown names are taken to be types and
- not other identifiers. `c-recognize-<>-arglists' is assumed to be set
- if this isn't nil."
- t nil
- objc '("id")
- idl '("sequence"
-
- "ref"))
- (c-lang-defconst c-<>-arglist-kwds
- "Keywords that can be followed by a C++ style template arglist; see
- `c-recognize-<>-arglists' for details. That language constant is
- assumed to be set if this isn't nil."
- t nil
- c++ '("template")
- idl '("fixed" "string" "wstring"))
- (c-lang-defconst c-<>-sexp-kwds
-
- t (delete-duplicates (append (c-lang-const c-<>-type-kwds)
- (c-lang-const c-<>-arglist-kwds))
- :test 'string-equal))
- (c-lang-defconst c-opt-<>-sexp-key
-
-
- t (if (c-lang-const c-recognize-<>-arglists)
- (c-make-keywords-re t (c-lang-const c-<>-sexp-kwds))))
- (c-lang-defvar c-opt-<>-sexp-key (c-lang-const c-opt-<>-sexp-key))
- (c-lang-defconst c-brace-id-list-kwds
- "Keywords that may be followed by a brace block containing a comma
- separated list of identifier definitions, i.e. like the list of
- identifiers that follows the type in a normal declaration."
- t (c-lang-const c-brace-list-decl-kwds))
- (c-lang-defconst c-block-stmt-1-kwds
- "Statement keywords followed directly by a substatement."
- t '("do" "else")
- c++ '("do" "else" "try")
- objc '("do" "else" "@finally" "@try")
- java '("do" "else" "finally" "try")
- idl nil)
- (c-lang-defconst c-block-stmt-1-key
-
-
- t (c-make-keywords-re t (c-lang-const c-block-stmt-1-kwds)))
- (c-lang-defvar c-block-stmt-1-key (c-lang-const c-block-stmt-1-key))
- (c-lang-defconst c-block-stmt-2-kwds
- "Statement keywords followed by a paren sexp and then by a substatement."
- t '("for" "if" "switch" "while")
- c++ '("for" "if" "switch" "while" "catch")
- objc '("for" "if" "switch" "while" "@catch" "@synchronized")
- java '("for" "if" "switch" "while" "catch" "synchronized")
- idl nil
- pike '("for" "if" "switch" "while" "foreach")
- awk '("for" "if" "while"))
- (c-lang-defconst c-block-stmt-2-key
-
-
- t (c-make-keywords-re t (c-lang-const c-block-stmt-2-kwds)))
- (c-lang-defvar c-block-stmt-2-key (c-lang-const c-block-stmt-2-key))
- (c-lang-defconst c-block-stmt-kwds
-
- t (delete-duplicates (append (c-lang-const c-block-stmt-1-kwds)
- (c-lang-const c-block-stmt-2-kwds))
- :test 'string-equal))
- (c-lang-defconst c-opt-block-stmt-key
-
-
-
- t (if (or (c-lang-const c-block-stmt-1-kwds)
- (c-lang-const c-block-stmt-2-kwds))
- (c-make-keywords-re t
- (append (c-lang-const c-block-stmt-1-kwds)
- (c-lang-const c-block-stmt-2-kwds)))))
- (c-lang-defvar c-opt-block-stmt-key (c-lang-const c-opt-block-stmt-key))
- (c-lang-defconst c-simple-stmt-kwds
- "Statement keywords followed by an expression or nothing."
- t '("break" "continue" "goto" "return")
- objc '("break" "continue" "goto" "return" "@throw")
-
- java '("break" "continue" "goto" "return" "throw")
- idl nil
- pike '("break" "continue" "return")
- awk '(
- "break" "continue" "return" "delete" "exit" "getline" "next"
- "nextfile" "print" "printf"))
- (c-lang-defconst c-simple-stmt-key
-
- t (c-make-keywords-re t (c-lang-const c-simple-stmt-kwds)))
- (c-lang-defvar c-simple-stmt-key (c-lang-const c-simple-stmt-key))
- (c-lang-defconst c-paren-stmt-kwds
- "Statement keywords followed by a parenthesis expression that
- nevertheless contains a list separated with ';' and not ','."
- t '("for")
- idl nil)
- (c-lang-defconst c-paren-stmt-key
-
- t (c-make-keywords-re t (c-lang-const c-paren-stmt-kwds)))
- (c-lang-defvar c-paren-stmt-key (c-lang-const c-paren-stmt-key))
- (c-lang-defconst c-asm-stmt-kwds
- "Statement keywords followed by an assembler expression."
- t nil
- (c c++) '("asm" "__asm__"))
- (c-lang-defconst c-opt-asm-stmt-key
-
-
- t (if (c-lang-const c-asm-stmt-kwds)
- (c-make-keywords-re t (c-lang-const c-asm-stmt-kwds))))
- (c-lang-defvar c-opt-asm-stmt-key (c-lang-const c-opt-asm-stmt-key))
- (c-lang-defconst c-case-kwds
- "The keyword\(s) which introduce a \"case\" like construct.
- This construct is \"<keyword> <expression> :\"."
- t '("case")
- awk nil)
- (c-lang-defconst c-case-kwds-regexp
-
- t (c-make-keywords-re t (c-lang-const c-case-kwds)))
- (c-lang-defvar c-case-kwds-regexp (c-lang-const c-case-kwds-regexp))
- (c-lang-defconst c-label-kwds
- "Keywords introducing colon terminated labels in blocks."
- t '("case" "default"))
- (c-lang-defconst c-label-kwds-regexp
-
- t (c-make-keywords-re t (c-lang-const c-label-kwds)))
- (c-lang-defvar c-label-kwds-regexp (c-lang-const c-label-kwds-regexp))
- (c-lang-defconst c-before-label-kwds
- "Keywords that might be followed by a label identifier."
- t '("goto")
- (java pike) (append '("break" "continue")
- (c-lang-const c-before-label-kwds))
- idl nil
- awk nil)
- (c-lang-defconst c-constant-kwds
- "Keywords for constants."
- t nil
- (c c++) '("NULL"
- "false" "true")
- objc '("nil" "Nil" "YES" "NO" "NS_DURING" "NS_HANDLER" "NS_ENDHANDLER")
- idl '("TRUE" "FALSE")
- java '("true" "false" "null")
- pike '("UNDEFINED"))
- (c-lang-defconst c-primary-expr-kwds
- "Keywords besides constants and operators that start primary expressions."
- t nil
- c++ '("operator" "this")
- objc '("super" "self")
- java '("this")
- pike '("this"))
- (c-lang-defconst c-expr-kwds
-
-
- t (delete-duplicates
- (append (c-lang-const c-primary-expr-kwds)
- (c-filter-ops (c-lang-const c-operator-list)
- t
- "\\`\\(\\w\\|\\s_\\)+\\'"))
- :test 'string-equal))
- (c-lang-defconst c-lambda-kwds
- "Keywords that start lambda constructs, i.e. function definitions in
- expressions."
- t nil
- pike '("lambda"))
- (c-lang-defconst c-inexpr-block-kwds
- "Keywords that start constructs followed by statement blocks which can
- be used in expressions \(the gcc extension for this in C and C++ is
- handled separately by `c-recognize-paren-inexpr-blocks')."
- t nil
- pike '("catch" "gauge"))
- (c-lang-defconst c-inexpr-class-kwds
- "Keywords that can start classes inside expressions."
- t nil
- java '("new")
- pike '("class"))
- (c-lang-defconst c-inexpr-brace-list-kwds
- "Keywords that can start brace list blocks inside expressions.
- Note that Java specific rules are currently applied to tell this from
- `c-inexpr-class-kwds'."
- t nil
- java '("new"))
- (c-lang-defconst c-opt-inexpr-brace-list-key
-
-
-
- t (and (c-lang-const c-inexpr-brace-list-kwds)
- (c-make-keywords-re t (c-lang-const c-inexpr-brace-list-kwds))))
- (c-lang-defvar c-opt-inexpr-brace-list-key
- (c-lang-const c-opt-inexpr-brace-list-key))
- (c-lang-defconst c-decl-block-key
-
-
-
-
-
- t (let* ((decl-kwds (append (c-lang-const c-class-decl-kwds)
- (c-lang-const c-other-block-decl-kwds)
- (c-lang-const c-inexpr-class-kwds)))
- (unambiguous (set-difference decl-kwds
- (c-lang-const c-type-start-kwds)
- :test 'string-equal))
- (ambiguous (intersection decl-kwds
- (c-lang-const c-type-start-kwds)
- :test 'string-equal)))
- (if ambiguous
- (concat (c-make-keywords-re t unambiguous)
- "\\|"
- (c-make-keywords-re t ambiguous))
- (c-make-keywords-re t unambiguous))))
- (c-lang-defvar c-decl-block-key (c-lang-const c-decl-block-key))
- (c-lang-defconst c-bitfield-kwds
- "Keywords that can introduce bitfields."
- t nil
- (c c++ objc) '("char" "int" "long" "signed" "unsigned"))
- (c-lang-defconst c-opt-bitfield-key
-
-
- t nil
- (c c++) (c-make-keywords-re t (c-lang-const c-bitfield-kwds)))
- (c-lang-defvar c-opt-bitfield-key (c-lang-const c-opt-bitfield-key))
- (c-lang-defconst c-other-kwds
- "Keywords not accounted for by any other `*-kwds' language constant."
- t nil
- idl '("truncatable"
-
-
- "entity" "process" "service" "session" "storage"))
- (eval-and-compile
- (defconst c-kwds-lang-consts
-
- (let (list)
- (mapatoms (lambda (sym)
- (when (and (boundp sym)
- (string-match "-kwds\\'" (symbol-name sym)))
-
-
- (setq list (cons (intern (symbol-name sym)) list))))
- c-lang-constants)
- list)))
- (c-lang-defconst c-keywords
-
- t (delete-duplicates
- (c-lang-defconst-eval-immediately
- `(append ,@(mapcar (lambda (kwds-lang-const)
- `(c-lang-const ,kwds-lang-const))
- c-kwds-lang-consts)
- nil))
- :test 'string-equal))
- (c-lang-defconst c-keywords-regexp
-
- t (c-make-keywords-re t (c-lang-const c-keywords)))
- (c-lang-defvar c-keywords-regexp (c-lang-const c-keywords-regexp))
- (c-lang-defconst c-keyword-member-alist
-
-
-
- t (let ((kwd-list-alist
- (c-lang-defconst-eval-immediately
- `(list ,@(mapcar (lambda (kwds-lang-const)
- `(cons ',kwds-lang-const
- (c-lang-const ,kwds-lang-const)))
- c-kwds-lang-consts))))
- lang-const kwd-list kwd
- result-alist elem)
- (while kwd-list-alist
- (setq lang-const (caar kwd-list-alist)
- kwd-list (cdar kwd-list-alist)
- kwd-list-alist (cdr kwd-list-alist))
- (while kwd-list
- (setq kwd (car kwd-list)
- kwd-list (cdr kwd-list))
- (unless (setq elem (assoc kwd result-alist))
- (setq result-alist (cons (setq elem (list kwd)) result-alist)))
- (unless (memq lang-const (cdr elem))
- (setcdr elem (cons lang-const (cdr elem))))))
- result-alist))
- (c-lang-defvar c-keywords-obarray
-
-
-
-
-
-
-
-
-
-
-
-
-
- (let* ((alist (c-lang-const c-keyword-member-alist))
- kwd lang-const-list
- (obarray (make-vector (* (length alist) 2) 0)))
- (while alist
- (setq kwd (caar alist)
- lang-const-list (cdar alist)
- alist (cdr alist))
- (setplist (intern kwd obarray)
-
-
-
-
-
- (apply 'nconc (mapcar (lambda (lang-const)
- (list lang-const t))
- lang-const-list))))
- obarray))
- (c-lang-defconst c-regular-keywords-regexp
-
-
- t (c-make-keywords-re t
- (set-difference (c-lang-const c-keywords)
- (append (c-lang-const c-primitive-type-kwds)
- (c-lang-const c-constant-kwds))
- :test 'string-equal)))
- (c-lang-defvar c-regular-keywords-regexp
- (c-lang-const c-regular-keywords-regexp))
- (c-lang-defconst c-primary-expr-regexp
-
-
-
-
-
-
-
- t (let* ((prefix-ops
- (c-filter-ops (c-lang-const c-operators)
- '(prefix)
- (lambda (op)
-
-
- (not (string-match "\\s)" op)))))
- (nonkeyword-prefix-ops
- (c-filter-ops prefix-ops
- t
- "\\`\\(\\s.\\|\\s(\\|\\s)\\)+\\'"))
- (in-or-postfix-ops
- (c-filter-ops (c-lang-const c-operators)
- '(postfix
- postfix-if-paren
- left-assoc
- right-assoc
- right-assoc-sequence)
- t))
- (unambiguous-prefix-ops (set-difference nonkeyword-prefix-ops
- in-or-postfix-ops
- :test 'string-equal))
- (ambiguous-prefix-ops (intersection nonkeyword-prefix-ops
- in-or-postfix-ops
- :test 'string-equal)))
- (concat
- "\\("
-
-
- (c-make-keywords-re t
- (append (c-lang-const c-primary-expr-kwds)
- (set-difference prefix-ops nonkeyword-prefix-ops
- :test 'string-equal)))
- "\\|"
-
- (c-make-keywords-re nil
- (intersection nonkeyword-prefix-ops in-or-postfix-ops
- :test 'string-equal))
- "\\)"
- "\\|"
-
- (c-lang-const c-symbol-start)
- "\\|"
-
-
- "\\.?[0-9]"
- "\\|"
-
- (c-make-keywords-re nil
- (set-difference nonkeyword-prefix-ops in-or-postfix-ops
- :test 'string-equal))
- "\\|"
-
- "\\s\""
- (if (memq 'gen-string-delim c-emacs-features)
- "\\|\\s|"
- ""))))
- (c-lang-defvar c-primary-expr-regexp (c-lang-const c-primary-expr-regexp))
- (c-lang-defconst c-decl-prefix-re
- "Regexp matching something that might precede a declaration, cast or
- label, such as the last token of a preceding statement or declaration.
- This is used in the common situation where a declaration or cast
- doesn't start with any specific token that can be searched for.
- The regexp should not match bob; that is done implicitly. It can't
- require a match longer than one token. The end of the token is taken
- to be at the end of the first submatch, which is assumed to always
- match. It's undefined whether identifier syntax (see
- `c-identifier-syntax-table') is in effect or not. This regexp is
- assumed to be a superset of `c-label-prefix-re' if
- `c-recognize-colon-labels' is set.
- Besides this, `c-decl-start-kwds' is used to find declarations.
- Note: This variable together with `c-decl-start-re' and
- `c-decl-start-kwds' is only used to detect \"likely\"
- declaration/cast/label starts. I.e. they might produce more matches
- but should not miss anything (or else it's necessary to use text
- properties - see the next note). Wherever they match, the following
- construct is analyzed to see if it indeed is a declaration, cast or
- label. That analysis is not cheap, so it's important that not too
- many false matches are triggered.
- Note: If a declaration/cast/label start can't be detected with this
- variable, it's necessary to use the `c-type' text property with the
- value `c-decl-end' on the last char of the last token preceding the
- declaration. See the comment blurb at the start of cc-engine.el for
- more info."
-
-
-
-
- t "\\([\{\}\(\);,]+\\)"
- java "\\([\{\}\(;,<]+\\)"
-
-
-
- c++ "\\([\{\}\(\);,<]+\\)"
-
-
-
-
- objc (concat "\\([\{\}\(\);,]+\\|"
- (c-make-keywords-re nil (c-lang-const c-protection-kwds))
- "\\)")
-
-
- pike "\\([\{\}\(\)\[;,]+\\)")
- (c-lang-defvar c-decl-prefix-re (c-lang-const c-decl-prefix-re)
- 'dont-doc)
- (c-lang-defconst c-decl-start-re
- "Regexp matching the start of any declaration, cast or label.
- It's used on the token after the one `c-decl-prefix-re' matched. This
- regexp should not try to match those constructs accurately as it's
- only used as a sieve to avoid spending more time checking other
- constructs."
- t (c-lang-const c-identifier-start))
- (c-lang-defvar c-decl-start-re (c-lang-const c-decl-start-re))
- (c-lang-defconst c-decl-prefix-or-start-re
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- t (if (c-lang-const c-decl-start-kwds)
- (concat (c-lang-const c-decl-prefix-re)
- "\\|"
- (c-make-keywords-re t (c-lang-const c-decl-start-kwds)))
- (c-lang-const c-decl-prefix-re)))
- (c-lang-defvar c-decl-prefix-or-start-re
- (c-lang-const c-decl-prefix-or-start-re)
- 'dont-doc)
- (c-lang-defconst c-cast-parens
-
-
- t (c-filter-ops (c-lang-const c-operators)
- '(prefix)
- "\\`\\s\(\\'"
- (lambda (op) (elt op 0))))
- (c-lang-defvar c-cast-parens (c-lang-const c-cast-parens))
- (c-lang-defconst c-block-prefix-disallowed-chars
- "List of syntactically relevant characters that never can occur before
- the open brace in any construct that contains a brace block, e.g. in
- the \"class Foo: public Bar\" part of:
- class Foo: public Bar {int x();} a, *b;
- If parens can occur, the chars inside those aren't filtered with this
- list.
- '<' and '>' should be disallowed even if angle bracket arglists can
- occur. That since the search function needs to stop at them anyway to
- ensure they are given paren syntax.
- This is used to skip backward from the open brace to find the region
- in which to look for a construct like \"class\", \"enum\",
- \"namespace\" or whatever. That skipping should be as tight as
- possible for good performance."
-
-
- t (set-difference
- (c-lang-const c-nonsymbol-token-char-list)
- (c-filter-ops (append (c-lang-const c-identifier-ops)
- (list (cons nil
- (c-lang-const c-after-id-concat-ops))))
- t
- t
- (lambda (op)
- (let ((pos 0) res)
- (while (string-match "\\(\\s.\\|\\s(\\|\\s)\\)"
- op pos)
- (setq res (cons (aref op (match-beginning 1)) res)
- pos (match-end 0)))
- res))))
-
- t (if (c-lang-const c-opt-cpp-prefix)
- (set-difference (c-lang-const c-block-prefix-disallowed-chars)
- '(?#))
- (c-lang-const c-block-prefix-disallowed-chars))
-
- (c++ objc idl) (set-difference (c-lang-const c-block-prefix-disallowed-chars)
- '(?:))
-
- (c++ java) (set-difference (c-lang-const c-block-prefix-disallowed-chars)
- '(?,))
-
-
- (java pike) (set-difference (c-lang-const c-block-prefix-disallowed-chars)
- '(?\( ?\)))
-
- (c c++ objc) (set-difference (c-lang-const c-block-prefix-disallowed-chars)
- '(?\" ?')))
- (c-lang-defconst c-block-prefix-charset
- ;; `c-block-prefix-disallowed-chars' as an inverted charset suitable
- ;; for `c-syntactic-skip-backward'.
- t (c-make-bare-char-alt (c-lang-const c-block-prefix-disallowed-chars) t))
- (c-lang-defvar c-block-prefix-charset (c-lang-const c-block-prefix-charset))
- (c-lang-defconst c-type-decl-prefix-key
- "Regexp matching the declarator operators that might precede the
- identifier in a declaration, e.g. the \"*\" in \"char *argv\". This
- regexp should match \"(\" if parentheses are valid in declarators.
- The end of the first submatch is taken as the end of the operator.
- Identifier syntax is in effect when this is matched \(see
- `c-identifier-syntax-table')."
- t (if (c-lang-const c-type-modifier-kwds)
- (concat (regexp-opt (c-lang-const c-type-modifier-kwds) t) "\\>")
-
- "\\<\\>")
-
-
- (c objc) (concat "\\("
- "[*\(]"
- "\\|"
- (c-lang-const c-type-decl-prefix-key)
- "\\)"
- "\\([^=]\\|$\\)")
- c++ (concat "\\("
- "[*\(&]"
- "\\|"
- (c-lang-const c-type-decl-prefix-key)
- "\\|"
- (concat "\\("
-
-
-
-
- (c-lang-const c-identifier-start)
- "\\)")
- "\\)"
- "\\([^=]\\|$\\)")
- pike "\\(\\*\\)\\([^=]\\|$\\)")
- (c-lang-defvar c-type-decl-prefix-key (c-lang-const c-type-decl-prefix-key)
- 'dont-doc)
- (c-lang-defconst c-type-decl-suffix-key
- "Regexp matching the declarator operators that might follow after the
- identifier in a declaration, e.g. the \"[\" in \"char argv[]\". This
- regexp should match \")\" if parentheses are valid in declarators. If
- it matches an open paren of some kind, the type declaration check
- continues at the corresponding close paren, otherwise the end of the
- first submatch is taken as the end of the operator. Identifier syntax
- is in effect when this is matched (see `c-identifier-syntax-table')."
-
-
- t (if (c-lang-const c-type-modifier-kwds)
- (concat "\\(\(\\|"
- (regexp-opt (c-lang-const c-type-modifier-kwds) t) "\\>"
- "\\)")
- "\\(\(\\)")
- (c c++ objc) (concat
- "\\("
- "[\)\[\(]"
- (if (c-lang-const c-type-modifier-kwds)
- (concat
- "\\|"
-
-
-
- (regexp-opt (c-lang-const c-type-modifier-kwds) t)
- "\\>")
- "")
- "\\)")
- (java idl) "\\([\[\(]\\)")
- (c-lang-defvar c-type-decl-suffix-key (c-lang-const c-type-decl-suffix-key)
- 'dont-doc)
- (c-lang-defconst c-after-suffixed-type-decl-key
- "This regexp is matched after a declarator expression where
- `c-type-decl-suffix-key' has matched. If it matches then the
- construct is taken as a declaration. It's typically used to match the
- beginning of a function body or whatever might occur after the
- function header in a function declaration or definition. It's
- undefined whether identifier syntax (see `c-identifier-syntax-table')
- is in effect or not.
- Note that it's used in cases like after \"foo (bar)\" so it should
- only match when it's certain that it's a declaration, e.g \"{\" but
- not \",\" or \";\"."
- t "{"
-
-
-
-
-
-
- t (if (c-lang-const c-postfix-spec-kwds)
-
- (concat (c-lang-const c-after-suffixed-type-decl-key)
- "\\|"
- (c-make-keywords-re t (c-lang-const c-postfix-spec-kwds)))
- (c-lang-const c-after-suffixed-type-decl-key))
-
-
-
-
-
- c++ "[{:]")
- (c-lang-defvar c-after-suffixed-type-decl-key
- (c-lang-const c-after-suffixed-type-decl-key)
- 'dont-doc)
- (c-lang-defconst c-after-suffixed-type-maybe-decl-key
-
-
- t (concat "\\(" (c-lang-const c-after-suffixed-type-decl-key) "\\)"
- "\\|[;,]"))
- (c-lang-defvar c-after-suffixed-type-maybe-decl-key
- (c-lang-const c-after-suffixed-type-maybe-decl-key))
- (c-lang-defconst c-opt-type-concat-key
- "Regexp matching operators that concatenate types, e.g. the \"|\" in
- \"int|string\" in Pike. The end of the first submatch is taken as the
- end of the operator. nil in languages without such operators. It's
- undefined whether identifier syntax (see `c-identifier-syntax-table')
- is in effect or not."
- t nil
- pike "\\([|.&]\\)\\($\\|[^|.&]\\)")
- (c-lang-defvar c-opt-type-concat-key (c-lang-const c-opt-type-concat-key)
- 'dont-doc)
- (c-lang-defconst c-opt-type-suffix-key
- "Regexp matching operators that might follow after a type, or nil in
- languages that don't have such operators. The end of the first
- submatch is taken as the end of the operator. This should not match
- things like C++ template arglists if `c-recognize-<>-arglists' is set.
- It's undefined whether identifier syntax (see `c-identifier-syntax-table')
- is in effect or not."
- t nil
- (c c++ objc pike) "\\(\\.\\.\\.\\)"
- java (concat "\\(\\[" (c-lang-const c-simple-ws) "*\\]\\|\\.\\.\\.\\)"))
- (c-lang-defvar c-opt-type-suffix-key (c-lang-const c-opt-type-suffix-key))
- (c-lang-defvar c-known-type-key
-
-
-
-
-
- (let* ((extra-types
- (when (boundp (c-mode-symbol "font-lock-extra-types"))
- (c-mode-var "font-lock-extra-types")))
- (regexp-strings
- (apply 'nconc
- (mapcar (lambda (re)
- (when (string-match "[][.*+?^$\\]" re)
- (list re)))
- extra-types)))
- (plain-strings
- (apply 'nconc
- (mapcar (lambda (re)
- (unless (string-match "[][.*+?^$\\]" re)
- (list re)))
- extra-types))))
- (concat "\\<\\("
- (c-concat-separated
- (append (list (c-make-keywords-re nil
- (append (c-lang-const c-primitive-type-kwds)
- plain-strings)))
- regexp-strings)
- "\\|")
- "\\)\\>")))
- (c-lang-defconst c-special-brace-lists
- "List of open- and close-chars that makes up a pike-style brace list,
- i.e. for a ([ ]) list there should be a cons (?\\[ . ?\\]) in this
- list."
- t nil
- pike '((?{ . ?}) (?\[ . ?\]) (?< . ?>)))
- (c-lang-defvar c-special-brace-lists (c-lang-const c-special-brace-lists))
- (c-lang-defconst c-recognize-knr-p
- "Non-nil means K&R style argument declarations are valid."
- t nil
- c t)
- (c-lang-defvar c-recognize-knr-p (c-lang-const c-recognize-knr-p))
- (c-lang-defconst c-recognize-typeless-decls
- "Non-nil means function declarations without return type should be
- recognized. That can introduce an ambiguity with parenthesized macro
- calls before a brace block. This setting does not affect declarations
- that are preceded by a declaration starting keyword, so
- e.g. `c-typeless-decl-kwds' may still be used when it's set to nil."
- t nil
- (c c++ objc) t)
- (c-lang-defvar c-recognize-typeless-decls
- (c-lang-const c-recognize-typeless-decls))
- (c-lang-defconst c-recognize-<>-arglists
- "Non-nil means C++ style template arglists should be handled. More
- specifically, this means a comma separated list of types or
- expressions surrounded by \"<\" and \">\". It's always preceded by an
- identifier or one of the keywords on `c-<>-type-kwds' or
- `c-<>-arglist-kwds'. If there's an identifier before then the whole
- expression is considered to be a type."
- t (or (consp (c-lang-const c-<>-type-kwds))
- (consp (c-lang-const c-<>-arglist-kwds))))
- (c-lang-defvar c-recognize-<>-arglists (c-lang-const c-recognize-<>-arglists))
- (c-lang-defconst c-enums-contain-decls
- "Non-nil means that an enum structure can contain declarations."
- t nil
- java t)
- (c-lang-defvar c-enums-contain-decls (c-lang-const c-enums-contain-decls))
- (c-lang-defconst c-recognize-paren-inits
- "Non-nil means that parenthesis style initializers exist,
- i.e. constructs like
- Foo bar (gnu);
- in addition to the more classic
- Foo bar = gnu;"
- t nil
- c++ t)
- (c-lang-defvar c-recognize-paren-inits (c-lang-const c-recognize-paren-inits))
- (c-lang-defconst c-recognize-paren-inexpr-blocks
- "Non-nil to recognize gcc style in-expression blocks,
- i.e. compound statements surrounded by parentheses inside expressions."
- t nil
- (c c++) t)
- (c-lang-defvar c-recognize-paren-inexpr-blocks
- (c-lang-const c-recognize-paren-inexpr-blocks))
- (c-lang-defconst c-opt-<>-arglist-start
-
-
-
-
-
- t (if (c-lang-const c-recognize-<>-arglists)
- (concat "\\("
- (c-lang-const c-symbol-key)
- "\\)"
- (c-lang-const c-syntactic-ws)
- "<")))
- (c-lang-defvar c-opt-<>-arglist-start (c-lang-const c-opt-<>-arglist-start))
- (c-lang-defconst c-opt-<>-arglist-start-in-paren
-
-
-
- t (if (c-lang-const c-opt-<>-arglist-start)
- (concat "\\("
- (c-lang-const c-opt-<>-arglist-start)
- "\\)\\|\\s\)")))
- (c-lang-defvar c-opt-<>-arglist-start-in-paren
- (c-lang-const c-opt-<>-arglist-start-in-paren))
- (c-lang-defconst c-opt-postfix-decl-spec-key
-
-
-
-
-
- t nil
- c++ (concat ":?"
- (c-lang-const c-simple-ws) "*"
- "\\(virtual" (c-lang-const c-simple-ws) "+\\)?\\("
- (c-make-keywords-re nil (c-lang-const c-protection-kwds))
- "\\)" (c-lang-const c-simple-ws) "+"
- "\\(" (c-lang-const c-symbol-key) "\\)")
- java (c-make-keywords-re t (c-lang-const c-postfix-spec-kwds)))
- (c-lang-defvar c-opt-postfix-decl-spec-key
- (c-lang-const c-opt-postfix-decl-spec-key))
- (c-lang-defconst c-recognize-colon-labels
- "Non-nil if generic labels ending with \":\" should be recognized.
- That includes labels in code and access keys in classes. This does
- not apply to labels recognized by `c-label-kwds' and
- `c-opt-extra-label-key'."
- t nil
- (c c++ objc java pike) t)
- (c-lang-defvar c-recognize-colon-labels
- (c-lang-const c-recognize-colon-labels))
- (c-lang-defconst c-label-prefix-re
- "Regexp like `c-decl-prefix-re' that matches any token that can precede
- a generic colon label. Not used if `c-recognize-colon-labels' is
- nil."
- t "\\([{};]+\\)")
- (c-lang-defvar c-label-prefix-re
- (c-lang-const c-label-prefix-re))
- (c-lang-defconst c-nonlabel-token-key
- "Regexp matching things that can't occur in generic colon labels,
- neither in a statement nor in a declaration context. The regexp is
- tested at the beginning of every sexp in a suspected label,
- i.e. before \":\". Only used if `c-recognize-colon-labels' is set."
- t (concat
-
- (c-make-keywords-re t
- (set-difference (c-lang-const c-keywords)
- (append (c-lang-const c-label-kwds)
- (c-lang-const c-protection-kwds))
- :test 'string-equal)))
-
- (c objc java pike idl) (concat "\"\\|"
- (c-lang-const c-nonlabel-token-key))
-
-
-
- c++ (concat "\\s\(\\|\"\\|" (c-lang-const c-nonlabel-token-key)))
- (c-lang-defvar c-nonlabel-token-key (c-lang-const c-nonlabel-token-key))
- (c-lang-defconst c-nonlabel-token-2-key
- "Regexp matching things that can't occur two symbols before a colon in
- a label construct. This catches C++'s inheritance construct \"class foo
- : bar\". Only used if `c-recognize-colon-labels' is set."
- t "\\<\\>"
- c++ (c-make-keywords-re t '("class")))
- (c-lang-defvar c-nonlabel-token-2-key (c-lang-const c-nonlabel-token-2-key))
- (c-lang-defconst c-opt-extra-label-key
- "Optional regexp matching labels.
- Normally, labels are detected according to `c-nonlabel-token-key',
- `c-decl-prefix-re' and `c-nonlabel-decl-prefix-re'. This regexp can
- be used if there are additional labels that aren't recognized that
- way."
- t nil
- objc (c-make-keywords-re t (c-lang-const c-protection-kwds)))
- (c-lang-defvar c-opt-extra-label-key (c-lang-const c-opt-extra-label-key))
- (c-lang-defconst c-opt-friend-key
-
-
-
-
-
- t nil
- c++ (concat "friend" (c-lang-const c-simple-ws) "+"
- "\\|"
- (concat "template"
- (c-lang-const c-simple-ws) "*"
- "<.+>"
- (c-lang-const c-simple-ws) "*"
- "friend"
- (c-lang-const c-simple-ws) "+")))
- (c-lang-defvar c-opt-friend-key (c-lang-const c-opt-friend-key))
- (c-lang-defconst c-opt-method-key
-
-
- t nil
- objc (concat
-
- "^\\s *"
- "\\([+-]\\)"
- (c-lang-const c-simple-ws) "*"
- (concat "\\("
- "([^\)]*)"
- (c-lang-const c-simple-ws) "*"
- "\\)?")
- "\\(" (c-lang-const c-symbol-key) "\\)"))
- (c-lang-defvar c-opt-method-key (c-lang-const c-opt-method-key))
- (c-lang-defconst c-type-decl-end-used
-
-
-
-
-
- t (or (c-lang-const c-recognize-colon-labels)
- (and (c-lang-const c-label-kwds) t))
-
-
- objc t)
- (c-lang-defvar c-type-decl-end-used (c-lang-const c-type-decl-end-used))
- (defconst c-lang-variable-inits (cc-eval-when-compile c-lang-variable-inits))
- (defconst c-emacs-variable-inits (cc-eval-when-compile c-emacs-variable-inits))
- (defmacro c-make-emacs-variables-local ()
- `(progn
- ,@(mapcar (lambda (init)
- `(make-local-variable ',(car init)))
- (cdr c-emacs-variable-inits))))
- (defun c-make-init-lang-vars-fun (mode)
- "Create a function that initializes all the language dependent variables
- for the given mode.
- This function should be evaluated at compile time, so that the
- function it returns is byte compiled with all the evaluated results
- from the language constants. Use the `c-init-language-vars' macro to
- accomplish that conveniently."
- (if (and (not load-in-progress)
- (boundp 'byte-compile-dest-file)
- (stringp byte-compile-dest-file))
-
-
-
-
- `(lambda ()
-
-
- (let ((c-buffer-is-cc-mode ',mode)
- current-var source-eval)
- (c-make-emacs-variables-local)
- (condition-case err
- (if (eq c-version-sym ',c-version-sym)
- (setq ,@(let ((c-buffer-is-cc-mode mode)
- (c-lang-const-expansion 'immediate))
-
-
-
- (mapcan
- (lambda (init)
- `(current-var ',(car init)
- ,(car init) ,(cl-macroexpand-all
- (elt init 1))))
-
-
-
- (append (cdr c-emacs-variable-inits)
- (cdr c-lang-variable-inits)))))
-
-
-
-
-
-
-
-
- (setq source-eval t)
- (let ((init ',(append (cdr c-emacs-variable-inits)
- (cdr c-lang-variable-inits))))
- (while init
- (setq current-var (caar init))
- (set (caar init) (eval (cadar init)))
- (setq init (cdr init)))))
- (error
- (if current-var
- (message "Eval error in the `c-lang-defvar' or `c-lang-setvar' for `%s'%s: %S"
- current-var
- (if source-eval
- (format "\
- (fallback source eval - %s compiled with CC Mode %s but loaded with %s)"
- ',mode ,c-version c-version)
- "")
- err)
- (signal (car err) (cdr err)))))))
-
-
-
- `(lambda ()
- (require 'cc-langs)
- (let ((c-buffer-is-cc-mode ',mode)
- (init (append (cdr c-emacs-variable-inits)
- (cdr c-lang-variable-inits)))
- current-var)
- (c-make-emacs-variables-local)
- (condition-case err
- (while init
- (setq current-var (caar init))
- (set (caar init) (eval (cadar init)))
- (setq init (cdr init)))
- (error
- (if current-var
- (message
- "Eval error in the `c-lang-defvar' or `c-lang-setver' for `%s' (source eval): %S"
- current-var err)
- (signal (car err) (cdr err)))))))
- ))
- (defmacro c-init-language-vars (mode)
- "Initialize all the language dependent variables for the given mode.
- This macro is expanded at compile time to a form tailored for the mode
- in question, so MODE must be a constant. Therefore MODE is not
- evaluated and should not be quoted."
- `(funcall ,(c-make-init-lang-vars-fun mode)))
- (cc-provide 'cc-langs)
|