nspredicate-parser

module
v0.0.0-...-568b5cd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2023 License: BSD-3-Clause

README

Introduction

Objective-C NSPredicate, NSExpression parser in Golang. Created for own usage and work.

Compiling & Running Objective-C and Swift file

Objective-C

gcc -framework Foundation ./objective-c/example.m

Swift

swift ./swift/example.swift

The [cd] flags

[c] flag will enable case-insensitive filtering.

[d] flag will enable diacritic-insensitive filtering.

Examples of diacritics include French accent marks, German umlauts and 'sharp s', Spanish 'tilde n'.

e.g.

René Descartes vs Rene Descartes

Français vs Francais

reiß vs reiss

español vs espanol

EBNF (Extended Backus-Naur form)

alphabet = "a" | "b" | ... | "z" | "A" | "B" | ... | "Z" ; (omitted for brevity)

digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;

operator = "==" | "=" | "!=" | "<" | "<=" | ">=" | ">" | "beginswith" | "endswith" | "contains" | "matches" ;

logical operator = "and" | "or" | "all" | "any" ;

special value = "true" | "false" | "YES" | "NO" | "NULL" | "nil" ;

blank = " " | "\n" \ "t" | "\r" | "\f" | "\b" ;

symbol = "(" | ")" | "[" | "]" | "{" | "}" | "," ;

identifier = { "_" } , alphabet , { alphabet | digit | "_" } ;

quotes = "'" | '"' ;

Documentation

NSPredicate | Apple Documentation

NSExpression | Apple Documentation

Predicate Programming Guide | Apple Documentation Archive

token module | Go Standard Library

scanner module | Go Standard Library

ast module | Go Standard Library

Reference & Article

Article on NSPredicate by Fluffy.es (Axel)

Handwritten Parsers & Lexers in Go by Ben Jonhnson

SQL parser in Go by Mariano Gappa

NSPredicate by Mattt

Introduction to Abstract Syntax by Arkadiusz Ziobrowski

Directories

Path Synopsis
internal
ns
Package ns contains NS objects represented in Go.
Package ns contains NS objects represented in Go.
Package parser provides a parser for Objective-C NSPredicate.
Package parser provides a parser for Objective-C NSPredicate.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL