Skip to content

ambiguity between strings and keywords #32

Description

@ggs67

Analyzing the csync2 parser for extending the auto command I stumbled over a problem with an ambiguity between unquoted strings and keywords. For example if a host is called "auto", the statement 'host auto' will fail requiring quotes because auto is a keyword.

If you want to give it a try I have modified the flex and bison files in the parser-path branch of my fork. I can also file a pull request.

https://github.com/ggs67/csync2/tree/parser-patch

Commit comment of modifications:

1. Disambiguation of strings

  Modified lexer with non-exclusive start state STRTOKEN for strings without quotes.
  This resolves the conflict where strings matching keywords will fail if not quoted
  (ex. 'host auto;' required 'host "auto";')

2. Tokenized auto-methods

  Modified auto-methods from separate C-parsing code to include those by separate tokens in the
  lexer.

  This change was done to cleanup parsing, becoming more readable and in prepartation to extend the
  auto command.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions