Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: Java
A predictive parser (a top-down parser without backtracking) insists  that the grammar must be left-factored.
    grammar  a new equivalent grammar suitable for predictive parsing
stmt  if  expr  then  stmt  else  stmt    |
         if  expr  then  stmt

when we see  if, we cannot now which production rule to choose to  re-write stmt in the derivation.
A  abB | aB | cdg | cdeB | cdfB

A  aA’ | cdg | cdeB | cdfB
A’  bB | B

A  aA’ | cdA’’
A’  bB | B
A’’  g | eB | fB

please i need coures code of left factoring by java
this program checked in tha string if the left factoring in the string find it and
remove it
Posted 28-Nov-12 7:29am
joshrduncan2012 at 28-Nov-12 12:36pm
"I need" doesn't work here. What have you tried? Where are you stuck? Can you show us your attempt in solving this problem?
Sergey Alexandrovich Kryukov at 28-Nov-12 12:36pm
"I need... code" is not a question. Any particular problem? and please format the code properly, if you want to ask the question. It's not readable right now.
joshrduncan2012 at 28-Nov-12 14:50pm
Nice answer SA! :)
ryanb31 at 28-Nov-12 13:47pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I've started you off, just fill in the blanks:
package com.factor;
 * Application class for factorisation project.
public class FactorApplication {
    public void main(String[] args) {
        // code goes here.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 295
1 DamithSL 295
2 Sergey Alexandrovich Kryukov 197
3 Peter Leow 155
4 Afzaal Ahmad Zeeshan 154
0 OriginalGriff 7,510
1 DamithSL 5,494
2 Sergey Alexandrovich Kryukov 4,954
3 Maciej Los 4,936
4 Kornfeld Eliyahu Peter 4,514

Advertise | Privacy | Mobile
Web01 | 2.8.141223.1 | Last Updated 30 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100