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

James.yang/lexer refactor #11

Closed
wants to merge 62 commits into from

Conversation

JamesYang007
Copy link
Owner

First draft of lexer.

@JamesYang007 JamesYang007 changed the base branch from master to james.yang/lexer_parser January 13, 2020 06:37
@JamesYang007 JamesYang007 changed the base branch from james.yang/lexer_parser to james.yang/cmake_init January 13, 2020 06:37
@JamesYang007 JamesYang007 force-pushed the james.yang/lexer_refactor branch from 50de6bc to 150bb43 Compare January 13, 2020 06:43
Copy link
Owner Author

@JamesYang007 JamesYang007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed

src/core/status.hpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@kentjhall kentjhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really awesome! The big changes are to change to processing one token at a time (the process function should just return a Token), and to change the file_reader to take a FILE * and not worry about opening/closing.

src/core/status.hpp Outdated Show resolved Hide resolved
src/io/file_reader.hpp Outdated Show resolved Hide resolved
status_.tokens.reserve(DEFAULT_TOKEN_ARR_SIZE);
}

void process()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change the lexer to process one token at a time!

src/core/status.hpp Show resolved Hide resolved
Copy link
Collaborator

@kentjhall kentjhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the things we've talked about

@@ -0,0 +1,300 @@
#pragma once
#include "token.hpp"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make these includes relative paths from src/

BEGIN_BLOCK_COMMENT,
END_BLOCK_COMMENT,
// special tags
TAGNAME,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need symbols for each tag individually mb :'(

@JamesYang007
Copy link
Owner Author

Closing this PR for now since we're moving towards Trie implementation. See #13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants