Information about Syntax Highlighting
- For syntax highlighting of source in Wikipedia and other wikis using MediaWiki, see Wikipedia:Text editor support or the .

HTML syntax highlighting
Syntax highlighting is a feature of some text editors that displays text—especially source code—in different colors and fonts according to the category of terms. This feature eases writing in a structured language such as a programming language or a markup language as both structures and syntax errors are visually distinct. Some editors also integrate syntax highlighting with other features, such as spell checking or code folding.
Practical considerations
Syntax highlighting is one strategy to improve the readability and context of the text; especially for code that spans several pages. The reader can easily ignore large sections of comments or code, depending on what one desires.Syntax highlighting also helps programmers find errors in their program. For example, most editors highlight string literals in a different color. Consequently, spotting a missing delimiter is much easier because of the contrasting color of the text.
Brace matching is another important feature with many popular editors. This makes it simple to see if a brace has been left out or locate the match of the brace the cursor is on by highlighting the pair in a different color.
Some text editors can also export the color markup in a format that is suitable for printing or for importing into word-processing or other kinds of text-formatting software; for instance a HTML, colorized LaTeX, PostScript or RTF version of its syntax highlighting.
At least one commentator has argued that syntax highlighting encourages programmers to skim through code without making an effort of understanding it, and that, for typographical reasons, highlighted code is actually less legible than plain code.[1]
Document class
For editors that support more than one language, the user can specify the language of the text, such as C, LaTeX, HTML, or the text editor can automatically recognize it based on the file extension or by scanning contents of the file.One approach for supporting syntax highlighting for multiple languages is the use of "Document classes". Each separate language constitutes a separate "class" of document. Each "class" can be associated with a specific set of syntax coloring rules. This approach affords a certain degree of flexibility for multi-language editors, but there are some potential limitations as well.
For example, sometimes a user may want to:
- treat a single document as belonging to more than just one document class (for example when editing an HTML file that contains embedded Javascript code).
- edit a language that does not belong to a recognized class (for example when editing source code for an obscure or relatively new programming language).
Syntax elements
Most editors with syntax highlighting allow different colors and text styles to be given to dozens of different lexical sub-elements of syntax. These include keywords, comments, control-flow statements, variables, and other elements. Programmers often heavily customize their settings in an attempt to show as much useful information as possible without making the code difficult to read.Example
Below is a snippet of syntax highlighted C++ code:>
// Allocate all the windows
for (int i = 0; i < max; i++)
{
wins[i] = new Window();
}
In this example, the editor has recognized the keywords
for, int, and new. It recognized the variable names i, wins, and max and highlighted them accordingly. The comment at the beginning is also highlighted in a specific manner to distinguish it from working code.
History and limitations
The Live Parsing Editor (LEXX or LPEX) was written for the computerization of the Oxford English Dictionary in 1985 and was probably the first to use color syntax highlighting. Its live parsing capability allowed user-supplied parsers to be added to the editor, for text, programs, data file, etc. See: LEXX – A programmable structured editor, Cowlishaw, M. F., IBM Journal of Research and Development, Vol 31, No. 1, 1987, IBM Reprint order number G322-0151Since most text editors highlight syntax based on complex pattern matching heuristics rather than actually implementing a parser for each possible language, which could be prohibitively complex, the highlighting is almost never completely accurate. Moreover, depending on the pattern matching algorithms, the highlighting "engine" can become very slow for certain types of language structures. Some editors overcome this problem by not always parsing the whole file but rather just the visible area, sometimes scanning backwards in the text up to a limited number of lines for "syncing".
See the Programming features section of the Comparison of text editors article for a list of some editors that have syntax highlighting.
References
text editor is a type of program used for editing plain text files.
Text editors are often provided with operating systems or software development packages, and can be used to change configuration files and programming language source code.
..... Click the link for more information.
Text editors are often provided with operating systems or software development packages, and can be used to change configuration files and programming language source code.
Plain text files vs.
..... Click the link for more information.
source code (commonly just source or code) is any sequence of statements and/or declarations written in some human-readable computer programming language.
..... Click the link for more information.
..... Click the link for more information.
This article or section is in need of attention from an expert on the subject.
Please help recruit one or [ improve this article] yourself. See the talk page for details.
..... Click the link for more information.
Please help recruit one or [ improve this article] yourself. See the talk page for details.
..... Click the link for more information.
A programming language is an artificial language that can be used to control the behavior of a machine, particularly a computer. Programming languages, like natural languagess, are defined by syntactic and semantic rules which describe their structure and meaning respectively.
..... Click the link for more information.
..... Click the link for more information.
markup language provides a way to combine a text and extra information about it. The extra information, including structure, layout, or other information, is expressed using markup, which is typically intermingled with the primary text.
..... Click the link for more information.
..... Click the link for more information.
For 2003 film, see .
In computer science a syntax error ( IPA: /ˈsɪntæks ɛrə(ɹ)/ ) refers to an error in the syntax of a sequence of characters or tokens that is intended to be written in a particular programming language.
..... Click the link for more information.
In computing, a spell checker is a software program designed to verify the spelling of words. A spell checker helps a user to ensure correct spelling, while suggesting corrections for wrongly spelled words.
..... Click the link for more information.
..... Click the link for more information.
Code folding is a feature of some text editors, source code editors and IDEs that allows the user to selectively hide and display sections of a currently-edited file as a part of routine edit operations.
..... Click the link for more information.
..... Click the link for more information.
A string literal is the representation of a string value within the source code of a computer program. There exist numerous alternate notations for specifying string literals, and the exact notation depends on the individual programming language in question.
..... Click the link for more information.
..... Click the link for more information.
For the page description language, see .
A postscript (from post scriptum, a Latin expression meaning "after writing" and abbreviated P.S.
..... Click the link for more information.
Rich Text Format
File extension:
MIME type:
Type code: 'RTF '
Uniform Type Identifier: public.rtf
Magic:
..... Click the link for more information.
File extension:
.rtfMIME type:
text/rtfType code: 'RTF '
Uniform Type Identifier: public.rtf
Magic:
..... Click the link for more information.
Typography is the art and techniques of type design, modifying type glyphs, and arranging type. Type glyphs (characters) are created and modified using a variety of illustration techniques.
..... Click the link for more information.
..... Click the link for more information.
C
The C Programming Language, Brian Kernighan and Dennis Ritchie, the original edition that served for many years as an informal specification of the language.
..... Click the link for more information.
The C Programming Language, Brian Kernighan and Dennis Ritchie, the original edition that served for many years as an informal specification of the language.
..... Click the link for more information.
Latex refers generically to a stable dispersion (emulsion) of polymer microparticles in an aqueous medium. Latexes may be natural or synthetic. Latex as found in nature is the milky sap of many plants that coagulates on exposure to air.
..... Click the link for more information.
..... Click the link for more information.
HTML (Hypertext Markup Language)
File extension:
MIME type:
Type code: TEXT
..... Click the link for more information.
File extension:
.html, .htmMIME type:
text/htmlType code: TEXT
..... Click the link for more information.
HTML (Hypertext Markup Language)
File extension:
MIME type:
Type code: TEXT
..... Click the link for more information.
File extension:
.html, .htmMIME type:
text/htmlType code: TEXT
..... Click the link for more information.
JavaScript
Paradigm: multi-paradigm
Appeared in: 1995
Designed by: Brendan Eich
Developer: Netscape Communications Corporation, Mozilla Foundation
Typing discipline: dynamic, weak, duck
Major implementations: SpiderMonkey, Rhino, KJS, JavaScriptCore
..... Click the link for more information.
Paradigm: multi-paradigm
Appeared in: 1995
Designed by: Brendan Eich
Developer: Netscape Communications Corporation, Mozilla Foundation
Typing discipline: dynamic, weak, duck
Major implementations: SpiderMonkey, Rhino, KJS, JavaScriptCore
..... Click the link for more information.
Snippet is a programming term for a small region of re-usable source code or text. Ordinarily, these are formally-defined operative units to incorporate into larger programming modules.
..... Click the link for more information.
..... Click the link for more information.
C++
Paradigm: Multi-paradigm
Appeared in: 1983
Designed by: Bjarne Stroustrup
Typing discipline: Static, unsafe, nominative
Major implementations: G++, Microsoft Visual C++, Borland C++ Builder
Dialects: ISO/IEC C++ 1998, ISO/IEC C++ 2003
..... Click the link for more information.
Paradigm: Multi-paradigm
Appeared in: 1983
Designed by: Bjarne Stroustrup
Typing discipline: Static, unsafe, nominative
Major implementations: G++, Microsoft Visual C++, Borland C++ Builder
Dialects: ISO/IEC C++ 1998, ISO/IEC C++ 2003
..... Click the link for more information.
In computer programming, a keyword is a word or identifier that has a particular meaning to the programming language. The meaning of keywords -- and, indeed, the meaning of the notion of keyword -- differs widely from language to language.
..... Click the link for more information.
..... Click the link for more information.
variable (IPA pronunciation: [ˈvæɹiəbl]) (sometimes called a pronumeral) is a symbolic representation denoting a quantity or expression.
..... Click the link for more information.
..... Click the link for more information.
prologue comments indicated in red and inline comments in green. Program code is in blue.]]
In computer programming, a comment is a programming language construct used to embed information in the source code of a computer program.
..... Click the link for more information.
In computer programming, a comment is a programming language construct used to embed information in the source code of a computer program.
..... Click the link for more information.
The Oxford English Dictionary (OED) is a dictionary published by the Oxford University Press (OUP), and is the most comprehensive dictionary of the English language.
..... Click the link for more information.
..... Click the link for more information.
In computer science, pattern matching is the act of checking for the presence of the constituents of a given pattern. In contrast to pattern recognition, the pattern is rigidly specified. Such a pattern concerns conventionally either sequences or tree structures.
..... Click the link for more information.
..... Click the link for more information.
For heuristics in computer science, see .
A heuristic is a method for helping in solving of a problem, commonly informal. It is particularly used for a method that often rapidly leads to a solution that is usually reasonably close to the best
..... Click the link for more information.
parsing (more formally syntactic analysis) is the process of analyzing a sequence of tokens to determine its grammatical structure with respect to a given formal grammar. A parser is the component of a compiler that carries out this task.
..... Click the link for more information.
..... Click the link for more information.
? 3.7 Free GPL Yes
Diakonos Pistos 2004 0.8.3 Free GPL Yes
e Alexander Stigsen 2005 1.0.1 $34.95 Proprietary No
ed Ken Thompson 1970 unchanged from original Free / Yes
EditPlus Sangil Kim 1998 2.31 $30 Shareware No
EmEditor Pro Emurasoft, Inc. ? 6.00.3 $39.
..... Click the link for more information.
Diakonos Pistos 2004 0.8.3 Free GPL Yes
e Alexander Stigsen 2005 1.0.1 $34.95 Proprietary No
ed Ken Thompson 1970 unchanged from original Free / Yes
EditPlus Sangil Kim 1998 2.31 $30 Shareware No
EmEditor Pro Emurasoft, Inc. ? 6.00.3 $39.
..... Click the link for more information.
This article is copied from an article on Wikipedia.org - the free encyclopedia created and edited by online user community. The text was not checked or edited by anyone on our staff. Although the vast majority of the wikipedia encyclopedia articles provide accurate and timely information please do not assume the accuracy of any particular article. This article is distributed under the terms of GNU Free Documentation License.
Herod_Archelaus