Preprocessore

In informatica, un preprocessore o precompilatore è un programma (o una porzione di programma) che effettua sostituzioni testuali sul codice sorgente di un programma, ovvero la precompilazione. I più comuni tipi di sostituzioni sono l'espansione di macro, l'inclusione di altri file, e la compilazione condizionale. Tipicamente, il preprocessore viene lanciato nel processo di compilazione di un software, e il file risultante verrà preso in input da un compilatore.

Descrizione

Tradizionalmente, i preprocessori sono programmi autonomi, ma per motivi di efficienza, si può avere un solo programma che incorpora le funzioni di un preprocessore e di un compilatore, oppure le funzioni di un preprocessore e di un interprete.

Un linguaggio di programmazione dotato di un preprocessore standard è il linguaggio C. In tale linguaggio, si fa un uso massiccio delle funzioni del preprocessore, per dichiarare le funzioni di libreria utilizzate, per definire costanti, e anche per definire piccole routine da espandere in-line. Di tale preprocessore è dotato anche il linguaggio C++; tuttavia, nei programmi scritti in C++ è possibile farne un uso meno massiccio, grazie ad alcune caratteristiche di questo linguaggio (funzioni inline, template di classi e di funzioni, variabili const).

Un altro scopo comune dei preprocessori è permettere l'inserimento di codice di un linguaggio di alto livello, per esempio SQL, all'interno di un programma scritto in un linguaggio di più basso livello, per esempio C, COBOL, o Fortran. In tal caso, il preprocessore traduce le istruzioni del linguaggio di più alto livello in istruzioni del linguaggio di livello inferiore. L'inserimento di istruzioni SQL in codice scritto in altri linguaggi, detto "SQL embedded", è implementato da alcuni DBMS come, per esempio, Oracle e DB2.

L'uso massiccio di funzioni di preprocessore può rendere molto caotico il codice, pertanto i linguaggi di programmazione di formulazione recente forniscono caratteristiche che riducono o eliminano la necessità di usare preprocessori. Per esempio, il linguaggio Java non ha un preprocessore, mentre il linguaggio C# ha un preprocessore simile a quello del C, ma senza la possibilità di includere file né quella di definire macro parametrizzate.

Le istruzioni inserite nel codice per essere elaborate dal preprocessore sono solitamente dette "direttive". Per evitare al preprocessore l'onere di comprendere il linguaggio di programmazione ospitante, le direttive del precompilatore devono essere facilmente distinguibili dal resto del codice. Per esempio, nel preprocessore del C, le direttive sono righe che iniziano con il carattere "#".

Voci correlate

Controllo di autoritàGND (DE4544347-6
  Portale Informatica: accedi alle voci di Wikipedia che trattano di informatica

Read other articles:

 本表是動態列表,或許永遠不會完結。歡迎您參考可靠來源來查漏補缺。 潛伏於中華民國國軍中的中共間諜列表收錄根據公開資料來源,曾潛伏於中華民國國軍、被中國共產黨聲稱或承認,或者遭中華民國政府調查審判,為中華人民共和國和中國人民解放軍進行間諜行為的人物。以下列表以現今可查知時間為準,正確的間諜活動或洩漏機密時間可能早於或晚於以下所歸類…

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: 1934 United States Senate election in Connecticut – news · newspapers · books · scholar · JSTOR (June 2020) (Learn how and when to remove this message) For related races, see 1934 United States Senate elections. 1934 United States Senate election in Connecticut &#…

AwardMedal For Impeccable ServiceMedal For Impeccable Service 1st class (obverse)TypeLong service medalAwarded forLong service in the Soviet Armed ForcesPresented by Soviet UnionEligibilityCitizens of the Soviet UnionStatusNo longer awardedEstablishedJanuary 25, 19581st class2nd class3rd classRibbons of the Medal For Impeccable Service Obverse of the KGB 2nd variant Medal For Impeccable Service 1st class The Medal For Impeccable Service (Russian: Медаль «За безупречную …

First Summit of the Non-Aligned Movement, Belgrade The Socialist Federal Republic of Yugoslavia was one of the founding members of the Non-Aligned Movement. Its capital, Belgrade, was the host of the First Summit of the Non-Aligned Movement in early September 1961. The city also hosted the Ninth Summit in September 1989. Non-alignment and active participation in the movement was the corner-stone of the Cold War foreign policy and ideology of the Yugoslav federation.[1] As the only Europe…

Measure of amount of effort to change trajectory For other uses, see Delta-v (disambiguation). It has been suggested that Delta-v (physics) be merged into this article. (Discuss) Proposed since March 2024. This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Delta-v – news · newspapers · books · scholar · JSTOR (Mar…

Paraguayan footballer Not to be confused with Julio César Enciso (footballer, born 1974). In this Spanish name, the first or paternal surname is Enciso and the second or maternal family name is Espínola. Julio Enciso Enciso warming up with Brighton & Hove Albion in 2022Personal informationFull name Julio César Enciso Espínola[1]Date of birth (2004-01-23) 23 January 2004 (age 20)Place of birth Caaguazú, ParaguayHeight 1.73 m (5 ft 8 in)[2]Posit…

Fur trader and American pioneer Charles Autobees (1812–1882) Charles Autobees (1812–1882), whose last name was also spelled Urtebise and Ortivis, was a fur trader and pioneer in the American Old West. He was the founder of Autobees, Colorado. Early life Charles Autobees was born in St. Louis in 1812 to Francis Autobees and Sarah T. Tate. Francis was French-Canadian and may have had Native American heritage as well. After Francis drowned in the Saint Lawrence River while logging, Sarah marrie…

See also: 1903 Major League Baseball season The following are the baseball events of the year 1903 throughout the world. Overview of the events of 1903 in baseball Years in baseball ← 1900 1901 1902 1903 1904 1905 1906 → 1903 in sports Air sports American football Aquatic sports Association football Athletics Australian rules football Badminton Baseball Basketball Canadian football Chess Climbing Combat sports Sumo Cricket 1902–3 1903 1903–4 Cycling Dance sports Darts Equestrianism Espor…

Subspecialty of emergency medicine International emergency medicine is a subspecialty of emergency medicine that focuses not only on the global practice of emergency medicine but also on efforts to promote the growth of emergency care as a branch of medicine throughout the world. The term international emergency medicine generally refers to the transfer of skills and knowledge—including knowledge of ambulance operations and other aspects of prehospital care—from developed emergency m…

Shopping mall in Indiana, United StatesCollege MallLocationBloomington, Indiana, United StatesCoordinates39°09′41″N 86°29′45″W / 39.16139°N 86.49583°W / 39.16139; -86.49583Opening dateMarch 1965; 59 years ago (1965-03)DeveloperMelvin Simon & AssociatesManagementSimon Property GroupOwnerSimon Property GroupNo. of stores and services89No. of anchor tenants3 (2 open, 1 vacant)Total retail floor area537,034 square feet (49,892.1 square m…

Wrestling at the Olympics Men's freestyle bantamweightat the Games of the XIV OlympiadVenueEmpress Hall, Earls Court Exhibition CentreDates29–31 JulyCompetitors15 from 15 nationsMedalists Nasuh Akar  Turkey Gerald Leeman  United States Charles Kouyos  France← 19361952 → Wrestling at the1948 Summer OlympicsGreco-RomanFlymenBantammenFeathermenLightmenWeltermenMiddlemenLight heavymenHeavymenFreestyleFlymenBantammenFeathermenLightmenWeltermenMiddlemen…

For other uses, see Old Masters (disambiguation). 1985 box set series by Frank ZappaThe Old MastersBox set series by Frank ZappaReleasedBox One - April 1985Box Two - November 1986Box Three - December 1987GenreRockLabelBarking PumpkinProducerFrank ZappaFrank Zappa chronology Thing-Fish(1984) The Old Masters(1985) Frank Zappa Meets the Mothers of Prevention(1985) Does Humor Belong in Music?(1986) The Old Masters Box II(1986) Jazz from Hell(1986) London Symphony Orchestra, Vol. II(1…

Chinese badminton player (born 1980) Badminton playerCai Yun蔡赟Personal informationCountryChinaBorn (1980-01-19) 19 January 1980 (age 44)Suzhou, Jiangsu, ChinaHeight1.82 m (6 ft 0 in)[1]Weight65 kg (143 lb; 10.2 st)HandednessRightMen's doublesHighest ranking1 (7 September 2006[2] with Fu Haifeng) Medal record Men's badminton Representing  China Olympic Games 2012 London Men's doubles 2008 Beijing Men's doubles World Championships 20…

青富苑Ching Fu Court已完工的青富苑(2023年5月)概要類型綠表置居計劃地點香港葵青區地址青衣青衣路18號托建方 香港房屋委員會入伙年份2023年技术细节座数2住宅套数2,868单套面积187-471 平方英尺(ft²) 細山角度的青富苑(2024年3月) 青富苑(英語:Ching Fu Court),曾建議命名為青霖苑(英語:Ching Lam Court),是香港房屋委員會其中一個已落成之綠表置居計劃屋苑,位於香港新…

City in Bingham County, Idaho, United States City in Idaho, United StatesShelley, IdahoCityNorth State Street (U.S. Route 91) in Shelley, June 2008Location of Shelley in Bingham County, Idaho.Coordinates: 43°22′46″N 112°7′26″W / 43.37944°N 112.12389°W / 43.37944; -112.12389CountryUnited StatesStateIdahoCountyBinghamArea[1] • Total1.81 sq mi (4.68 km2) • Land1.81 sq mi (4.68 km2) • Water0…

This article includes a list of general references, but it lacks sufficient corresponding inline citations. Please help to improve this article by introducing more precise citations. (June 2011) (Learn how and when to remove this message) Arab Tribe Banu ʿAbs(Arabic: بنو عبس)Ghatafan, Qays, AdnaniteNisba(al-)ʿAbsīLocationSaudi Arabia, Oman, Qatar, Eritrea, Kuwait, Jordan, United Arab Emirates, Palestine, Syria, Lebanon, Yemen, Egypt, Arab world, Malaysia, Europe, United States, Canada, …

Protein calbindin 1, 28kDaNMR solution structure of Ca2+-loaded calbindin D28K.[1]IdentifiersSymbolCALB1Alt. symbolsCALBNCBI gene793HGNC1434OMIM114050RefSeqNM_004929UniProtP05937Other dataLocusChr. 8 p11Search forStructuresSwiss-modelDomainsInterPro calbindin 2, 29kDa (calretinin)IdentifiersSymbolCALB2NCBI gene794HGNC1435OMIM114051RefSeqNM_001740UniProtP22676Other dataLocusChr. 16 q22.1Search forStructuresSwiss-modelDomainsInterPro Calbindins are three different calcium-binding proteins:…

Hong Kong-based global supplier of electronic learning products This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) This article needs to be updated. Please help update this article to reflect recent events or newly available information. (April 2021) This article's lead section may be too short to adequately summarize the key points. Please consider expanding the lead to provide an accessible o…

Any of several folk traditions in East Asia describing a fox-like apparition Nine-tailed foxThe nine-tailed fox in the Shanhaijing, depicted in an edition from the Qing dynastyChinese nameChinese九尾狐Literal meaningnine-tailed foxTranscriptionsStandard MandarinHanyu PinyinjiǔwěihúYue: CantoneseJyutpinggau2 mei5 wu4Vietnamese nameVietnamese alphabethồ ly tinhcáo chín đuôiChữ Hán狐狸精Chữ Nôm𤞺𠃩𡳪Korean nameHangul구미호Hanja九尾狐TranscriptionsRevised Romanizatio…

Special forces regiment of the Malaysian Army This article is about Malaysian Army's special forces. For the TV series, see Gerak Khas (TV series). Gerak KhasGrup Gerak KhasGGK InsigniaFounded7 May 1965; 59 years ago (1965-05-07)Country MalaysiaAllegianceYang di-Pertuan Agong (King of Malaysia)Branch Malaysian ArmyTypeSpecial forcesSizeClassifiedNickname(s)'Komando' (English: Commando)'Beret Hijau' (English: Green Beret)Motto(s)Cepat dan Cergas(English: Fast and Agile…