Statistics
| Branch: | Revision:

root / json-lexer.c @ 2a2af967

History | View | Annotate | Download (9.3 kB)

# Date Author Comment
0b0404bf 01/13/2012 12:36 pm Stefan Weil

Add 'fall through' comments to case statements without break

These comments are used by static code analysis tools and in code reviews
to avoid false warnings because of missing break statements.

The case statements handled here were reported by coverity....

325601b4 06/07/2011 09:52 pm Anthony Liguori

json-lexer: limit the maximum size of a given token

Signed-off-by: Michael Roth <>
Signed-off-by: Anthony Liguori <>

529a0ef5 06/07/2011 09:52 pm Anthony Liguori

json-lexer: reset the lexer state on an invalid token

Signed-off-by: Michael Roth <>
Signed-off-by: Anthony Liguori <>

bd3924a3 06/07/2011 09:52 pm Michael Roth

json-lexer: fix flushing logic to not always go to error state

Currently we flush the lexer by passing in a NULL character. This
generally forces the lexer to go to the corresponding TERMINAL state
for whatever token type it is currently parsing, emits the token to the...

b011f619 06/07/2011 09:52 pm Michael Roth

json-lexer: make lexer error-recovery more deterministic

Currently when we reach an error state we effectively flush everything
fed to the lexer, which can put us in a state where we keep feeding
tokens into the parser at arbitrary offsets in the stream. This makes it...

33d05394 04/15/2011 09:25 pm Blue Swirl

json-lexer: fix conflict with mingw32 ERROR definition

The name ERROR is too generic, it conflicts with mingw32 ERROR definition.

Replace ERROR with IN_ERROR.

Signed-off-by: Blue Swirl <>

03308f6c 06/11/2010 09:25 pm Luiz Capitulino

json-lexer: Initialize 'x' and 'y'

The 'lexer' variable is passed by the caller, it can contain anything
(eg. garbage).

Signed-off-by: Luiz Capitulino <>

1041ba7a 06/11/2010 09:25 pm Luiz Capitulino

json-lexer: Handle missing escapes

The JSON escape sequence "\/" and "\\" are valid and should be
handled.

Signed-off-by: Luiz Capitulino <>

ecb50f5f 06/11/2010 09:25 pm Luiz Capitulino

json-lexer: Drop 'buf'

QString supports adding a single char, 'buf' is unneeded.

Signed-off-by: Luiz Capitulino <>

f7c05274 06/11/2010 09:25 pm Paolo Bonzini

implement optional lookahead in json lexer

Not requiring one extra character when lookahead is not necessary
ensures that clients behave properly even if they, for example,
send QMP requests without a trailing newline.

Signed-off-by: Paolo Bonzini <>...

28e91a68 06/11/2010 09:25 pm Paolo Bonzini

remove unnecessary lookaheads

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Luiz Capitulino <>

2c0d4b36 02/10/2010 08:47 pm Roy Tam

json: fix PRId64 on Win32

OK we are fooled by the json lexer and parser. As we use %I64d to
print 'long long' variables in Win32, but lexer and parser only deal
with %lld but not %I64d, this patch add support for %I64d and solve
'info pci', 'powser_reset' and 'power_powerdown' assert failure in...

5ab8558d 11/17/2009 04:49 pm Anthony Liguori

Add a lexer for JSON

Our JSON parser is a three stage parser. The first stage tokenizes the stream
into a set of lexical tokens. Since the lexical grammar is regular, we can
use a finite state machine to model it. The state machine will emit tokens
as they are identified....