Skip to content
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

Manufacturer part numbers in the grammar #7

Open
kasbah opened this issue Jan 23, 2018 · 5 comments
Open

Manufacturer part numbers in the grammar #7

kasbah opened this issue Jan 23, 2018 · 5 comments
Labels
antlr-port Issues only applicable to our attempt to port to antlr

Comments

@kasbah
Copy link
Member

kasbah commented Jan 23, 2018

@dvc94ch I noticed that you are adding MPNs for semi-conductors into the grammar itself. I am wondering: is this the best place for them?

It might work well for really common parts but ultimately it embeds preferences into the grammar that we might not want to embed there. People's preferences vary and new parts are introduced all the time.

My approach for exact MPNs was going to be to use the ignored output of the lax parser to query a parts database. Maybe we should restrict electro grammar to parse specs but ignore MPNs? What are your thoughts on this?

@dvc94ch
Copy link
Collaborator

dvc94ch commented Jan 23, 2018

Aren't most diode and transistor mpn's structured? For other components it makes sense I guess, although what kind of information would you like to extract other than if it's a diode/transistor/ic?

From a hdl perspective it should be possible to compile without internet access, and compilation should be deterministic, so involving an online database is not ideal. I can introduce caching into the build system for when 'offline', so rebuilds would work.

@kasbah
Copy link
Member Author

kasbah commented Jan 23, 2018

Structured how? I guess the manufacturers will follow a convention and there are a lot of common designs that are shared between different manufacturers. It may be a good optimization to include these in the grammar but I am not 100% convinced.

I didn't mean and online database necessarily, more like the a lookup like we do with the CPL parts.

In one of your emails you described the transistor support as something that would parse descriptions like "npn sot23 125mW beta=200 ic>=200mA" and that made a lot of sense to me.

@dvc94ch
Copy link
Collaborator

dvc94ch commented Jan 23, 2018

ah ok. there are as far as I can tell two standards in common use for discrete semiconductors. maybe a database would be better. the reason why I added the rules was because it was causing lexer ambiguity.

[0] https://en.wikipedia.org/wiki/JEDEC
[1] https://en.wikipedia.org/wiki/Pro_Electron

@kasbah
Copy link
Member Author

kasbah commented Jan 23, 2018

Ah, I wasn't really aware of these. Will study them. Sorry, what was causing the ambiguity?

@dvc94ch
Copy link
Collaborator

dvc94ch commented Jan 23, 2018

it was parsing 1N4007 incorrectly as 1 nano or something like that.

@kasbah kasbah added the antlr-port Issues only applicable to our attempt to port to antlr label Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
antlr-port Issues only applicable to our attempt to port to antlr
Projects
None yet
Development

No branches or pull requests

2 participants