(linguistics) (Of a formal language) which can be decided by a pushdown automaton or a context-free grammar (sense 1)
context-free
Definitions, parts of speech, synonyms, and sentence examples for context-free.
Editorial note
Technically, byte-strings (and nested comments) mean the lexer is not regular, but the grammar is still context-free.
Quick take
(linguistics) (Of a formal language) which can be decided by a pushdown automaton or a context-free grammar (sense 1)
Meaning at a glance
The clearest senses and uses of context-free gathered in one view.
(linguistics) (Of a grammar) which generates sentences in stages, in such a way that at any intermediate stage, any piece of the sentence is enough to determine the corresponding piece at the next stage; that is, the stagewise transformation at a point does not depend on the rest of the sentence
Definitions
Core meanings and parts of speech for context-free.
adjective
(linguistics) (Of a formal language) which can be decided by a pushdown automaton or a context-free grammar (sense 1)
adjective
(linguistics) (Of a grammar) which generates sentences in stages, in such a way that at any intermediate stage, any piece of the sentence is enough to determine the corresponding piece at the next stage; that is, the stagewise transformation at a point does not depend on the rest of the sentence
Example sentences
Technically, byte-strings (and nested comments) mean the lexer is not regular, but the grammar is still context-free.
Couldn't figure out how to say it well before because they are still not equivalent to context-free languages, they are just sometimes powerful enough to describe some of the context-free languages.
The idea is that by sticking to context-free grammars, protocols will be easier to parse, and the bulk of memory corruption errors can eliminated.
Why does it matter whether the exchange format is a regular or a context-free language?
I've always understood it to be this: A lexer is for a regular language (in the formal sense), whereas a parser is for a context-sensitive (or context-free) language.
Note that I never said that Rust reads a file more than once, or that Rust's grammar is not context-free.
I'm saying that people live in the real world with real contexts, not in Context-Free-Abstraction-Land.
Nom can handle easily regular, context-free and context sensitive grammars (a lot of binary formats are a bit context sensitive, so that was a requirement).
I found these structures cropping up alongside Horn clauses, and Context-Free Grammars in interesting ways.
What do you lose by sticking to context-free grammars?
I alse think the Great Firewall of China did simple context-free regex searches that would have caught the text in the JavaScript literals.
BTW the C grammar is not context-free either.
Quote examples
To sum it all up: most "regular expression" implementations are actually powerful enough to describe context-free grammars, which are essentially regular expressions mixed with balanced parentheses.
Here is a regex that decides if the number is a prime: perl -lne '(1x$_)!~ /^1?$|^(11+?)\1+$/ && print "$_ is prime"' This goes beyond context-free, therefore I couldn't just say "context-free" carelessly in the article.
The fact that the author manages to never use the term "context-free grammar" leads me to believe he's unduly surprised at his discovery.
Frequently asked questions
Short answers drawn from the clearest meanings and examples for this word.
How do you use context-free in a sentence?
Technically, byte-strings (and nested comments) mean the lexer is not regular, but the grammar is still context-free.
What does context-free mean?
(linguistics) (Of a formal language) which can be decided by a pushdown automaton or a context-free grammar (sense 1)
What part of speech is context-free?
context-free is commonly used as adjective.