I have i doubt in a problem,trying to calculate FOLLOW(S) which needs FOLLOW(A) in it,but as A production is after S production,we have not calculated FOLLOW(A) yet.So,should we add FOLLOW(A) too inf FOLLOW(S)???
Compiler Design First and follow
2.2k Views Asked by Omkar At
1
There are 1 best solutions below
Related Questions in PARSING
- How to resize images with PHP PARSE SDK
- Constraint not propagated upon instantiation of list members
- How can I parse fixed-length, non-delimited integers with attoparsec?
- jSon result optional value error
- Date parse with Timezone - Android
- URL Variable is not being recognized using NSURL
- Regex to get vCard base64 string (C#)
- Retrieving string value from label and then parsing into an integer, pyqt4
- How to use Papa Parse for javascript csv parsing
- How to parse/split a string?
- String concatenation with padded integers
- Is this file an XML or HTML file? How can I parse it?
- json parser to spinner
- Use DateTime format in a class but restrict time tokens
- Saving multiple occurrences of strstr() from a line in C?
Related Questions in COMPILER-CONSTRUCTION
- Is the compiler Xcode uses to produce Assembly code a bad compiler?
- How do compilers store hundreds of variables in only a few registers?
- Where to patch back the information gathered during program analysis
- Assignment Insertion in ROSE compiler after AssignOp
- memory layout of a multiple-inherited object in C++
- How to use my written compiler to read files on web?
- a LEX program to identify keywords and convert it into uppercase
- Identifier terminal except certain keywords
- Calling Scala compiler's AST from Java
- Computing the FOLLOW() set of a grammar
- JavaCC and Unicode issue. Why \u696d cannot be managed in JavaCC although it belong to the range "\u4e00"-"\u9fff"
- Three-address code and symbol tables
- Delegate caching behavior changes in Roslyn
- Get delimiter in Irony
- Compiler Errors including initializer before '<' token
Related Questions in GRAMMAR
- VoiceXML Grammar Input sequence
- Is the grammars in Java7 spec really equivalent?
- int* const* foo(int x); is a valid C function prototype. How do you "read" this return type?
- Identifier terminal except certain keywords
- Grammar: Precedence of grammar alternatives
- Context Free Grammar BNF
- ANTLR4 grammar conflicting rules
- Is it incorrect online version of EBNF standard, or incorrect the chapter's name by mr. Pattis?
- Cross reference to multiple names in the same grammar rule
- Xtext grammar describing cron expression not working as expected
- What are the Bison/yacc grammars for these
- Correct way of conjugating 3rd person singular in comments
- Xtext grammar rule composite
- Trying to find Shift/Reduce conflict in Grammar
- Why do we need the alternative definition `nested-name-specifier identifier ::` in the definition of the grammar production `nested-name-specifier`?
Related Questions in BOTTOM-UP
- How to fix the footer to bottom of the page?
- Knapsack 0-1 path reconstruction (which items to take)
- Bottom-Up-Parser: When to apply which reduction rule?
- How to return arbitrary XML Document using an Eclipse/AXIS2 POJO Service
- LR-Parsing-Table: What determines next state in reduce-actions?
- Positioning AndroidSlidingUpPanel to a specific height
- Can some one please provide the practical examples of stubs and drivers?
- Output produced for the given input using the bottom up parsing
- Cant initialize a 2d array/matrix to 0
- How can I add limited coins to the coin change problem? (Bottom-up - Dynamic programming)
- Is the following approach dynamic programming
- Compiler Design First and follow
- What are the problems with bottom up approach
- Spacial partitionning bottom up tree
- Identify data warehouse design methodologies in the following diagram
Related Questions in TOP-DOWN
- Top Down Parsing - Java
- XNA Waterphysics Top-Down Hex-based grid
- Combining lexer with many parsers
- Using ServletContextListener with top-down JAX-WS WebService in Websphere
- Making functions with Crafty.js
- LL(1) parser generator in OCaml
- How to configure SSL in WSDL First CXF Framework web service?
- Java: Iteration to find a coordinate point that hasn't been used?
- top-down rendering - how to solve state in pre-populated input fields
- Compiler Design First and follow
- Identify data warehouse design methodologies in the following diagram
- IsTouching and OverlapCollider contradicting each other?
- Is there a simple workflow to generate a database schema from classes with hibernate mappings?
- Top Down Vs Bottom Up - Normalisation
- Emacs Lisp: Byte-compiler warning for undefined functions in apply, mapcar
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?

To compute FOLLOW(S) for any non-terminal S, apply the followwing rules until nothing can be added to any FOLLOW set.
Place $ in FOLLOW(S), where S is the start symbol.
If there is a production S -> CBD, then everything in FIRST(D) except epsilon is in FOLLOW(B).
If there is a proudction S -> CB, or a production S -> CBD, where FIRST(D) contains epsilon, then everything in FOLLOW(S) is in FOLLOW(B).
SO, as you can see from the given grammar,
as per rule 1, the follow(S) will contains $.
Also, as per rule 2, S appears in bodies only followed by D(non-terminal), thus, everything except epsilon that is in FIRST(D) must be in FOLLOW(S). So, FOLLOW(S) must contain a.
Also,as per rule 3, considering the production A->ASD |epsilon and FIRST(D) contains epsilon, we should get FOLLOW(S) = FOLLOW(A).
So, yes you need to calculate FOLLOW(A) before FOLLOW(S).
And, FOLLOW(A) = everything in FIRST(S) except epsilon + b = {a,b}.
Hence, FOLLOW(S) = {a,b,f,$}.
I don't know how you come to calculate that FOLLOW(A) is required for calculating FOLLOW(S). It is not the case. Please again go through the rules 1 to 3 mentioned in the starting of this answer.