answersLogoWhite

0

Basically SLR is one of the type of LR parser.LR(1) is called as SLR(1).It is the easiest of all the three (SLR,CLR,LALR).

In all the three shift entries in the table are same but onlky reduce entries changes.In SLR reduce enteries are done using FOLLOW whereas in LALR n CLR reduce enteties are done using LOOKAHEAD.

LR(1)/SLR and LALR are having same no. of items i.e the core part is same whereas in LALR lookahead are included for reduce entries.

LALR suufers from REDUCE/REDUCE conflict whereas SLR suffers from SHIFT/REDUCE conflct

For more details :: read ulmaan n aho of compiler design.

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

How do you get software with XML parsers?

A lot of modern software comes with XML parsers (only if they're relevant, obviously). It would take major reworking of the software in question to incorporate XML parsers. Some modern browsers, PC games, and general applications that store data use XML parsers, and come with them after installation.


How do you show that a grammar is LALR but not SLR?

To show that a grammar is LALR but not SLR, you can construct a parsing table for the grammar and demonstrate that there are conflicts present in the SLR parsing table that are resolved in the LALR parsing table. Specifically, LALR parsers have larger look-ahead sets than SLR parsers which can resolve these conflicts. In other words, LALR parsers are able to distinguish between more parser states compared to SLR parsers, allowing them to handle more complex grammars.


Justfy that LALR parsers are faster than LR parsers?

LALR parsers have an equal number of states as an LR(0) parser. LR(1) parsers have a number of states dependent on the lookahead. Often different states are identical, except they have a different lookahead. i.e.Sample LR(1) item sets:1)A -> B.C,'x'A -> E.C,'y'2)A -> B.C,'g'A -> E.C,'h'Equivalent LALR(1) item set:1)A -> B.C,'x'A -> E.C,'y'A -> B.C,'g'A -> E.C,'h'Fewer states means fewer shifts and reduces. And at least as importantly, a much smaller parse table.


What is syntactic clues?

Syntactic clues are aids to parsing. The amount of nondeterminism in parsers for pairs of homomorphically related semithue language systems is compared. If the parsers are without lookahead, the domain language system parser has no more nondeterminism than the codomain language system parser. The domain language system has at least as many clues. If the parsers have lookahead and the homomorphism is nondecreasing the same results hold. If the homomorphism is nonincreasing, an example shows the codomain language system may have the better clues.


What is a client-side parser?

In general, a parser is a tool that interprets code.We talk about server-side parsers if those tools parse the code they receive before sending a result (i.e. the web page) to the client PC, while client-side parsers process code directly on the client PC.PHP is an example language that is parsed server-side, JavaScript is an example for a client-side language.


What is a client side parser?

In general, a parser is a tool that interprets code.We talk about server-side parsers if those tools parse the code they receive before sending a result (i.e. the web page) to the client PC, while client-side parsers process code directly on the client PC.PHP is an example language that is parsed server-side, JavaScript is an example for a client-side language.


What are the xml tools?

That depends on what you want to do, xml tools include; xml parsers xml validators xml editors xml schema editors xml code generators


What type of interpreter is used in HTML?

HTML is generally interpreted using a "parser." The parser reads the text, and puts it together using a series of "tokens" or in the case of an HTML document, "tags" or "elements." Parsing (also call syntactical analysis) is used frequently in Computer Science. The individual browser's use various parsers, changing from vendor to vendor and sometimes from one version to the next. This difference is precisely why different browsers will render the same HTML different way.


How read xml file in java?

Java provides several XML Parsers like DOM, SAX or JDOM and API javax.xml.parsers by using those we can easily read xml files in Java. DOM is quickest and easiest way to read XMlL file in Java.


Do people in France code in french?

I believe that most programming languages are written in English, however things such as variable names are programmer-defined; it is only the keywords that are unchangeable. I'm sure that someone can or has written parsers/compilers which accept keywords in languages other than English.


How are HTML and XHTML similar and different?

HTML and XHTML use a similar language syntax; tags, elements and everything. If you know HTML, you know messy XHTML: XHTML is a "clean" HTML. * Tags can be written in any case (uppercase or lowercase). * Some tags do not need to be closed. * HTML is parsed by systems based off of the Standard Generalized Markup Language (SGML). * HTML provides less accurate reading, and needs more time to read and manipulate data. * Some parsers cannot even manipulate HTML data, which is a big problem with more finicky devices (like mobile devices). * Tags must be written in lowercase. * All tags must be closed. * Tags must be properly nested -- no overlapping elements. * XHTML is parsed by XML parsers. * XHTML provides more accurate reading, and requires less time to read and manipuate data. * If a device can parse XML (which many modern devices can), the device can manipulate XHTML data to their needs (for example, to fit a website into the screen of a mobile phone).


What is the role of parser in compiler design?

· In the compiler model, the parser obtains a string of tokens from the lexical analyser, and verifies that the string can be generated by the grammar for the source language.· The parser returns any syntax error for the source language.· There are three general types' parsers for grammars.· Universal parsing methods such as the Cocke-Younger-Kasami algorithm andEarley's algorithm can parse any grammar. These methods are too inefficient to use in production compilers.· The methods commonly used in compilers are classified as either top-down parsing or bottom-up parsing.· Top-down parsers build parse trees from the top (root) to the bottom (leaves).· Bottom-up parsers build parse trees from the leaves and work up to the root.· In both case input to the parser is scanned from left to right, one symbol at a time.· The output of the parser is some representation of the parse tree for the stream of tokens.· There are number of tasks that might be conducted during parsing. Such as;o Collecting information about various tokens into the symbol table.o Performing type checking and other kinds of semantic analysis.o Generating intermediate code.