Concepts Of Programming Languages
Concepts Of Programming Languages
12th Edition
ISBN: 9780134997186
Author: Sebesta, Robert W.
Publisher: Pearson,
bartleby

Videos

Textbook Question
Book Icon
Chapter 3, Problem 1PS

The two mathematical models for language description are:

  • Recognition
  • Generation

These two mathematical models can define the syntax of programming language in the given manner,

Recognition:

  • It works on yes or no basis. In this method, a mechanism called recognition device (R) is used that can read strings from the given alphabet.
  • This would indicate whether the input string is in language or not. That means, it will either accept the string or reject the string.
  • Recognition device filters the correctly formed sentences from those that are incorrectly formed.
  • In recognition, recognizer is used for syntax. analysis. Recognizer does not check for all possible strings but it simply check if the given programs are in the language or not.
  • It checks the syntactical part of the program.

Generation:

  • In this method, a device named generator is used to generate the sentences in a language.
  • Whenever a generator is called, it generator a sentence which is unpredictable.
  • When a string is to be checked if it is a correct or incorrect, first of all, it calls the generator to generate a correct sentence.
  • Then, it compares the correct generated string with the input string.
  • Hence, it determines the correction in string.
Blurred answer
Students have asked these similar questions
can you help me with this questin because I don't understand it and I am having trouble with this can you do this step. by step and explain it in great detail and can you do something visual to help me understand it better. question:1.40 Recall that string x is a prefix of string y if a string z exists where xz = y, and that x is a proper prefix of y if in addition x 6= y. In each of the following parts, we define an operation on a language A. Show that the class of regular languages is closed under that operation. b. NOEXTEND(A) = {w ∈ A| w is not the proper prefix of any string in A}
I need help with my program. It needs to: Developing a language model based on the context-free grammar: Use the context-free grammar to develop a language model that can be used to generate coherent and grammatically correct sentences in American English. Incorporating semantic information into the context-free grammar: Expand the context- free grammar to incorporate semantic information, such as word meaning and context, to generate more meaningful sentences in American English. import java.util.*;import java.util.stream.Collectors;public class CFG {    private static Map<String, List<String>> rules;    public static void main(String[] args) {        rules = new HashMap<>();        initializeGrammarRules();        String sentence = generateSentence("S");        System.out.println(sentence);    }    private static void initializeGrammarRules() {        rules.put("S", Arrays.asList("NP VP"));        rules.put("NP", Arrays.asList("Det N", "Det AP N"));…
1.1 OBJECTIVE:Design a lexical analyzer for given language and the lexical analyzer should ignore redundant spaces, tabs and new lines. It should also ignore comments. Although the syntax specification states that identifiers can be arbitrarily long, you may restrict the length to some reasonable value. Simulate the same in C language.   1.2 PROGRAM LOGIC:   Read the input Expression        2. Check whether input is alphabet or digits then store it as identifier        3. If the input is is operator store it as symbol        4. Check the input for keywords
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Structured Chart; Author: Tutorials Point (India) Ltd.;https://www.youtube.com/watch?v=vdUO-sGA1DA;License: Standard YouTube License, CC-BY
Introduction to Structure Charts; Author: Christopher Kalodikis;https://www.youtube.com/watch?v=QN2bjNplGlQ;License: Standard Youtube License