Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Lexical analysis is the process of converting a sequence of characters into a sequence of tokens.
2
votes
Efficient C Tokenizer/Lexer in C++
I hate this:
buffer = (char*)malloc(file_size + 1);
assert(buffer != nullptr);
The trouble is that if you have a build system set up to build this it will probably define NDEBUG for productio …
4
votes
Simple C99 Lexer
Same Lexer writtern in Lex.
Lexer.l
startsIdentifier [a-zA-Z_]
isInIdentifier {startsIdentifier}|[0-9]
isHexChar [0-9A-Fa-f]
isOctal [0- …
1
vote
Simple C99 Lexer
Spotted a bug:
while (character == '/' && peekChar() == '/') {
skipLineComment();
character = skipWhitespace();
}
while (character == '/' && peekChar() == '*') {
skipBlockComment();
c …
5
votes
Accepted
Tokenizer for my programming language
Issues with EBNF
string ::= '"' {(any_character | string_escape)} '"';
Here for "any_character" you probably meant any character except " but that is not made explicit.
number ::= [('+' | '-')] {digi …
3
votes
Accepted
Tokenize and detect syntactic errors in simple math expressions
Observation
First observation use Flex/Bison. Learn it once it makes all this stuff trivial.
OK. Got that out the way. Looking at the current code.
Style
You treat tokenizing and analyzing as two …