About: Dangling else     Goto   Sponge   NotDistinct   Permalink

An Entity of Type : yago:WikicatFormalLanguages, within Data Space : dbpedia.org associated with source document(s)
QRcode icon
http://dbpedia.org/describe/?url=http%3A%2F%2Fdbpedia.org%2Fresource%2FDangling_else

The dangling else is a problem in programming of parser generators in which an optional else clause in an if–then(–else) statement results in nested conditionals being ambiguous. Formally, the reference context-free grammar of the language is ambiguous, meaning there is more than one correct parse tree. In many programming languages one may write conditionally executed code in two forms: the if-then form, and the if-then-else form – the else clause is optional: if a then sif b then s1 else s2 if a then if b then s else s2 if a then (if b then s) else s2if a then (if b then s else s2)

AttributesValues
rdf:type
rdfs:label
  • Nepovinné else (cs)
  • Dangling else (de)
  • Dangling else (en)
  • Dangling else (fr)
  • Dangling else problem (pl)
rdfs:comment
  • Nepovinné else (anglicky dangling else) v podmíněném příkazu způsobuje, že mnoho programovacích jazyků je nejednoznačných. Formální příčinou je, že bezkontextová gramatika příslušného jazyka je nejednoznačná, což znamená, že pro některé programy existuje více než jeden správný derivační strom. (cs)
  • Das Problem des dangling else (englisch dangling ‚baumelnd‘) ist ein Beispiel für eine scheinbare Mehrdeutigkeit einer Programmiersprache, die für Verwirrung sorgen kann, insbesondere bei falscher Einrückung. Tatsächlich ist die Semantik in den meisten Sprachen eindeutig definiert, schon weil die Grammatik der Sprache sonst nicht eindeutig zerlegbar wäre. Das Problem taucht in einigen Programmiersprachen (wie C, C++, Java) auf, wenn zwei verschachtelten if-Anweisungen nur ein else-Zweig gegenübersteht. Es kann nur auftreten, wenn eine optionale Klammerung weggelassen wird. (de)
  • En informatique, et notamment dans la conception et l'analyse des langages de programmation, le problème du dangling else (anglais que l'on pourrait traduire par le problème du « sinon pendant ») est un problème de programmation informatique qui résulte de l'ambiguïté de l'interprétation de la clause sinon dans l'imbrication de deux instructions conditionnelles de la forme si-alors-sinon. Formellement, la grammaire non contextuelle du langage est ambiguë, ce qui signifie qu'il peut y avoir plusieurs arbres d'analyse corrects pour une même instruction. (fr)
  • The dangling else is a problem in programming of parser generators in which an optional else clause in an if–then(–else) statement results in nested conditionals being ambiguous. Formally, the reference context-free grammar of the language is ambiguous, meaning there is more than one correct parse tree. In many programming languages one may write conditionally executed code in two forms: the if-then form, and the if-then-else form – the else clause is optional: if a then sif b then s1 else s2 if a then if b then s else s2 if a then (if b then s) else s2if a then (if b then s else s2) (en)
  • Dangling else problem to problem niejednoznaczności spotykanych w praktyce gramatyk bezkontekstowych. Niech polecenie redukuje się do if (warunek) polecenie, do if (warunek) polecenie else polecenie oraz do jakiegoś innego polecenia, np. zmienna = wyrażenie. Weźmy teraz polecenie: if (warunek1) if (warunek2) zmienna = wyrażenie else zmienna = wyrażenie Gramatyka w żaden sposób nie rozstrzyga do którego if odnosi się to else: if (warunek1) { if (warunek2) zmienna = wyrażenie else zmienna = wyrażenie } czy też: if (warunek1) { if (warunek2) zmienna = wyrażenie } else zmienna = wyrażenie (pl)
dcterms:subject
Wikipage page ID
Wikipage revision ID
Link from a Wikipage to another Wikipage
sameAs
dbp:wikiPageUsesTemplate
has abstract
  • Nepovinné else (anglicky dangling else) v podmíněném příkazu způsobuje, že mnoho programovacích jazyků je nejednoznačných. Formální příčinou je, že bezkontextová gramatika příslušného jazyka je nejednoznačná, což znamená, že pro některé programy existuje více než jeden správný derivační strom. (cs)
  • Das Problem des dangling else (englisch dangling ‚baumelnd‘) ist ein Beispiel für eine scheinbare Mehrdeutigkeit einer Programmiersprache, die für Verwirrung sorgen kann, insbesondere bei falscher Einrückung. Tatsächlich ist die Semantik in den meisten Sprachen eindeutig definiert, schon weil die Grammatik der Sprache sonst nicht eindeutig zerlegbar wäre. Das Problem taucht in einigen Programmiersprachen (wie C, C++, Java) auf, wenn zwei verschachtelten if-Anweisungen nur ein else-Zweig gegenübersteht. Es kann nur auftreten, wenn eine optionale Klammerung weggelassen wird. (de)
  • The dangling else is a problem in programming of parser generators in which an optional else clause in an if–then(–else) statement results in nested conditionals being ambiguous. Formally, the reference context-free grammar of the language is ambiguous, meaning there is more than one correct parse tree. In many programming languages one may write conditionally executed code in two forms: the if-then form, and the if-then-else form – the else clause is optional: if a then sif b then s1 else s2 This gives rise to an ambiguity in interpretation when there are nested statements, specifically whenever an if-then form appears as s1 in an if-then-else form: if a then if b then s else s2 In this example, s is unambiguously executed when a is true and b is true, but one may interpret s2 as being executed when a is false (thus attaching the else to the first if) or when a is true and b is false (thus attaching the else to the second if). In other words, one may see the previous statement as either of the following expressions: if a then (if b then s) else s2if a then (if b then s else s2) The dangling else problem dates to ALGOL 60, and has been resolved in various ways in subsequent languages. In LR parsers, the dangling else is the archetypal example of a shift-reduce conflict. (en)
  • En informatique, et notamment dans la conception et l'analyse des langages de programmation, le problème du dangling else (anglais que l'on pourrait traduire par le problème du « sinon pendant ») est un problème de programmation informatique qui résulte de l'ambiguïté de l'interprétation de la clause sinon dans l'imbrication de deux instructions conditionnelles de la forme si-alors-sinon. Formellement, la grammaire non contextuelle du langage est ambiguë, ce qui signifie qu'il peut y avoir plusieurs arbres d'analyse corrects pour une même instruction. (fr)
  • Dangling else problem to problem niejednoznaczności spotykanych w praktyce gramatyk bezkontekstowych. Niech polecenie redukuje się do if (warunek) polecenie, do if (warunek) polecenie else polecenie oraz do jakiegoś innego polecenia, np. zmienna = wyrażenie. Weźmy teraz polecenie: if (warunek1) if (warunek2) zmienna = wyrażenie else zmienna = wyrażenie Gramatyka w żaden sposób nie rozstrzyga do którego if odnosi się to else: if (warunek1) { if (warunek2) zmienna = wyrażenie else zmienna = wyrażenie } czy też: if (warunek1) { if (warunek2) zmienna = wyrażenie } else zmienna = wyrażenie Gramatykę taką zawsze można przekształcić w gramatykę jednoznaczną, zwykle zakładając że else dotyczy najwewnętrzniejszego wolnego if (czyli pierwsza z podanych wyżej interpretacji). Jest to również rozwiązanie najlepsze ze względu na strukturę analizatora składni: aby skojarzyć napotkany else z właściwym if nie potrzeba sprawdzać liczby else-ów następujących w dalszej części analizowanego napisu. (pl)
gold:hypernym
prov:wasDerivedFrom
page length (characters) of wiki page
foaf:isPrimaryTopicOf
is Link from a Wikipage to another Wikipage of
is Wikipage redirect of
is foaf:primaryTopic of
Faceted Search & Find service v1.17_git139 as of Feb 29 2024


Alternative Linked Data Documents: ODE     Content Formats:   [cxml] [csv]     RDF   [text] [turtle] [ld+json] [rdf+json] [rdf+xml]     ODATA   [atom+xml] [odata+json]     Microdata   [microdata+json] [html]    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 08.03.3330 as of Mar 19 2024, on Linux (x86_64-generic-linux-glibc212), Single-Server Edition (378 GB total memory, 54 GB memory in use)
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2024 OpenLink Software