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

How I can implement Multi-QuoteProcessor? #58

Closed
M4Lien opened this issue Dec 24, 2018 · 2 comments
Closed

How I can implement Multi-QuoteProcessor? #58

M4Lien opened this issue Dec 24, 2018 · 2 comments
Labels

Comments

@M4Lien
Copy link

M4Lien commented Dec 24, 2018

Hi renabr!
I am using your bibtex-parser. I've got bibtex file through sciencedirect, but it was invalid bib.
so I've reviewed the bibtex file. That file contains multi-quote. I guess it is the issue.
therefore, I am trying to implement quoteProcessor, so I need your help.

@renanbr
Copy link
Owner

renanbr commented Dec 27, 2018

Hi @M4Lien,

Processors can process entries only, because they are called by the Listener after parsing is done.

Here a summary of the internal mechanism:

  • Parser:
    • works like a tokenizer;
    • is responsible for finding units;
    • sends units to the Listener on the fly[1];
    • does not send invalid units to the Listener[2].
      • in other words, it throws an exception as it founds an unexpected char[3];
      • a char is checked against the chars already found in the streaming[4].
  • Listener:
    • receives valid units found by the Parser;
    • packs these units in a list of entries;
    • then calls attached processors.
  • Processor:
    • is attached to the Listener, not to the Parser;
    • traits entire and valid (lexically and syntactically) entries.

[1, 3, 4] If I understood your suggestion, what you want is viable/possible by changing these parser's behaviours, not via Processor.

[2] In the case mentioned in #57, the char q after a " (in this case it's closing a text content) is not recognized as a valid sequence.

@renanbr
Copy link
Owner

renanbr commented Dec 9, 2020

#48 (comment)

@renanbr renanbr closed this as completed Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants