Skip to content
#

lexer

A grammar describes the syntax of a programming language, and might be defined in Backus-Naur form (BNF). A lexer performs lexical analysis, turning text into tokens. A parser takes tokens and builds a data structure like an abstract syntax tree (AST). The parser is concerned with context: does the sequence of tokens fit the grammar? A compiler is a combined lexer and parser, built for a specific grammar.

Here are 708 public repositories matching this topic...

MTRNord
MTRNord commented Apr 25, 2018

Hi I want to check if the prevoius char is a :. The exact example code I have is this:

Prefix: !

I want basicly to be able to check based on if the previous char is a : the ! should get a string and later reuse the look back logic to check if I am inside an array which is defined like in yaml meaning to make sure the last 2 lines of the following example don't get into the ar

AccessViolator
AccessViolator commented Feb 24, 2020

Everything in diagrams.css should be scoped to some wrapping css class, because as is it cannot be bundled with the rest of an app's css because of styles like this:

div {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

svg {
    width: 100%;
}

Curre

logos
CAD97
CAD97 commented Apr 21, 2020

This shouldn't be too difficult to add support for.

As an example, \\u\{(?:10|[0-9])[0-9a-fA-F]{0,4}\} would just expand to \\u\{(?:10|[0-9])[0-9a-fA-F]?[0-9a-fA-F]?[0-9a-fA-F]?[0-9a-fA-F]?.

That is, expand to n copies of the repeated node and m-n copies of the repeated node but optional.

The "regex optimized" version would be expanding to nested optionals, so `nnn(?:m(?:m(?:m)?)?

SteelPhase
SteelPhase commented Nov 26, 2019

Would it be possible to have the regex parser support character classes like \w within other character classes? I had a regex pattern earlier that used the character class [0-9a-zA-Z_\.-], and I attempted to simplify it with [\w\.\-]. I didn't notice this library doesn't support doing that, and was wondering just how difficult that would be to implement. For the time being i'm just expanding

The regex-centric, fast lexical analyzer generator for C++ with full Unicode support. Faster than Flex and other regex matchers. Accepts Flex specifications. Generates reusable source code that is easy to understand. Easily integrates with Bison and other parsers. Includes a fast stand-alone regex engine and library.

  • Updated May 25, 2020
  • C++
roedoejet
roedoejet commented Aug 12, 2019

Hi there,

I appear to be getting some strange indenting errors. When I copy the quickstart .gel file and text and run the provided command, I get the error Exception: indent must be a multiple of 4, is 14 in line 24: u' user('

I am using Python 3.7.3, Visual Studio Code with spaces set to 4 and UTF-8 encoding.

Here is the copied quickstart syntax file:

# Define commonl
You can’t perform that action at this time.