FORTRAN is a:
View worked solution
Answer: C
Most real-world programming languages, including FORTRAN, are not context-free. They fall under the class of Context-Sensitive Languages (CSL) due to several semantic and syntactic features that cannot be verified by a pushdown automaton (PDA):
- Declare-before-use: A variable must be declared before it is used. This requires matching the identifier at its declaration with its subsequent usages, which is structurally equivalent to the language . This language is context-sensitive but not context-free.
- Type Checking and Parameter Matching: Verifying that the number and types of arguments in a function call match its definition also requires context-sensitive analysis.
While the phrase-structure (syntax) of programming languages is often approximated using Context-Free Grammars (CFGs) for parsing convenience, the complete language (including static semantics) is Context-Sensitive.
Hence, the correct option is C.
Free practice · Your answers on this page are not saved.
