Click here to Skip to main content
12,071,437 members (33,259 online)
Rate this:
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 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 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 28-Nov-12 14:50pm
Nice answer SA! :)
ryanb31 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.160208.1 | Last Updated 30 Nov 2012
Copyright © CodeProject, 1999-2016
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