-
Notifications
You must be signed in to change notification settings - Fork 1
feat/items-grammar, closures and goto #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
58ba95b to
af713a3
Compare
giospada
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non compila
giospada
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
riga 88: _first può può andare in loop infinito?
credo proprio di sì, fixo |
|
boh, io cambierei un po' tutto |
|
io creerei una struttura, per i first e i follow e mi atterrei al codice del prof, |
|
anche per ridurrei la lunghezza dei del file che è lunghissimo |
|
per esempio la struttura first si memorizza la tabella dei first |
|
cosa ne dici? |
Ridurre la lunghezza e ordinare un pò le cose sì. |
b08a92b to
b6708cd
Compare
|
si io i first and follow li precalcolerei in una struttura esterna, e poi passerei quella struttura per le altre funzioni a cui serve |
|
l'algoritmo delle dei first and follow lo trovi sulle slide |
* feat(first_follow): first version * test(first_follow): move tests * test(first_follow): remove old implementation of first and follow * test(first_follow): fix tests and first bug
giospada
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Io incomincierei a fare un piccolo refactor su questa parte, per esempio non mi piace la first and follow table, le terrei come due cose separate
src/grammar/first_follow.rs
Outdated
| Letter::NonTerminal(idx) => self.first_table.as_ref().unwrap()[*idx].clone(), | ||
| Letter::Terminal(ch) => { | ||
| let mut set = BTreeSet::new(); | ||
| set.insert(*ch); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTreeSet::from(*ch)
|
inoltre credo che come prima cosa bisognerebbe mettere aposto l'alfabeto, creare un alfabeto unico che possa essere utilizzato in tutta l'applicazione |
|
Item non sarebbe il caso di metterlo in un altro gruppo di directory tipo LR parser? |
No description provided.