Brace matching

Brace matching

Brace matching, or parentheses matching, is a syntax highlighting feature of certain text editors and integrated development environments that highlights matching sets of braces in languages such as Java and C++ that use them. The purpose is to help the programmer navigate through the code and also spot any improper matching, which would cause the program to not compile or malfunction. If a closing brace is left out, for instance, the compiler will not know that the end of the class definition has been reached. Brace matching is particularly useful when many nested if statements, program loops, etc. are involved.

Implementations

Vim's % command does brace matching, [ [http://heather.cs.ucdavis.edu/~matloff/ProgEdit/ProgEdit.html#L2314 Norm Matloff's Text-Editor Web Page for Programming Students ] ] and NetBeans has brace matching built-in. [ [http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-bracesmatching/overview-summary.html Overview (Editor Braces Matching) ] ] Brace matching can also be a tool for code navigation. In Visual Studio [ [http://msdn.microsoft.com/en-us/library/be94e8aw.aspx Automatic Brace Matching in Visual Studio] ] C++ 6.0, brace matching behavior was set to ignore braces found into comments. In VSC 7.0, its behavior was changed to compute commented braces. [ [http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=100587 Feedback: braces matching behavior ] ] IntelliJ IDEA's Ruby on Rails plugin also enables braces matching. [ [http://www.ajaxline.com/node/344 IntelliJ IDEA supports Ruby and Ruby on Rails | AjaxLine ] ] It has been proposed that Perl 5 be modified to facilitate braces matching. [ [http://dev.perl.org/perl6/rfc/145.html Brace-matching for Perl Regular Expressions - perl6 ] ] The Microsoft Excel 2003 formula bar has parentheses matching. Its implementation shows all the pairs of parentheses as different colors, so it is possible to easily analyze them all at once.

Example

for (int i = 0; i < 10; i++){:System.out.println(i);}

References


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • Syntax highlighting — is a feature of some text editors that displays text mdash;especially source code mdash;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… …   Wikipedia

  • Comparison of text editors — This article provides basic comparisons for common text editors. More feature details for text editors are available from the Category of text editor features and from the individual products articles. This article may not be up to date or… …   Wikipedia

  • Arduino — For other uses, see Arduino (disambiguation). Arduino Software A screenshot of the Arduino IDE showing the Blink pr …   Wikipedia

  • SpeedCommander — Infobox Software name = SpeedCommander developer = SpeedProject latest release version = 12.00 latest release date = October 2 2007 latest preview version = latest preview date = operating system = Windows genre = File manager license = Shareware …   Wikipedia

  • Microsoft Visual Studio — Visual Studio 2010 SP1 editing a WPF application Developer(s) …   Wikipedia

  • Indent style — In computer programming, an indent style is a convention governing the indentation of blocks of code to convey the program s structure. This article largely addresses the C programming language and its descendants, but can be (and frequently is)… …   Wikipedia

  • Bracket — 〈 redirects here. It is not to be confused with く, a Japanese kana. This article is about bracketing punctuation marks. For other uses, see Bracket (disambiguation). Due to technical restrictions, titles like :) redirect here. For typographical… …   Wikipedia

  • Saddle seat — is a style of horseback riding within the category of English riding that is designed to show off the high trotting action of certain horse breeds. The style developed into its modern form in the United States, and is also seen in Canada and… …   Wikipedia

  • Race and intelligence — Human intelligence Abilities and Traits …   Wikipedia

  • Ford Mustang (fifth generation) — Fifth generation Ford Mustang Manufacturer Ford Motor Company Model years 2005–present Assembly Flat Rock, Michigan, USA …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”