Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix wording and typos in README.

  • Loading branch information...
commit 42fc63815b0393e750e298ad7b4ec344bec6d28a 1 parent e11e130
Volkan YAZICI authored
Showing with 71 additions and 37 deletions.
  1. +6 −7 README
  2. +30 −30 packages.lisp
  3. +35 −0 specials.lisp
13 README
View
@@ -8,10 +8,10 @@ commonly used streams, for efficiently stepping backward and forward
through the input. It is tested on SBCL but should be portable to
other implementations as well.
-meta-sexp is implemented using a modular transformation
-processers. Therefore, besides builtin grammar transformators coming
-with meta-sexp, you can easily add your own transformation rules to
-meta-sexp too. (See REGISTER-TRANSFORMATION macro in meta-sexp.lisp.)
+meta-sexp is implemented using modular transformation processors.
+Therefore, besides builtin grammar transformators coming with
+meta-sexp, you can easily add your own transformation keywords to
+meta-sexp too. (See DEFINE-TRANSFORMATION macro in meta-sexp.lisp.)
Inspired by src/parser.lisp of core-stream project at
http://core.gen.tr/
@@ -155,7 +155,6 @@ SPACE? TAB? UPPER? WHITE-SPACE?
(Similar to `?' in regular expressions.)
(:* FORM FORM ...)
-
Sequentially evaluates supplied FORMs within an AND scope until it
returns NIL. Regardless of the return value of ANDed FORMs, block
returns T. (Similar to `*' in regular expressions.)
@@ -171,8 +170,8 @@ SPACE? TAB? UPPER? WHITE-SPACE?
Checks type of the atom at the current position through supplied
function(s).
-(:RULE RULE)
-(:RULE (OR RULE RULE ...))
+(:RULE RULE ARG ARG ...)
+(:RULE (OR RULE RULE ...) ARG ARG ...)
Tests input in the current cursor position using specified
type/form. If any, supplied arguments will get passed to rule.
60 packages.lisp
View
@@ -32,33 +32,33 @@
(:documentation "LL(1) parser generator in META using s-expressions.")
(:use :cl)
(:export :defatom
- :defrule
- :defrenderer
- :parser-context
- :parser-context-error
- :create-parser-context
- :make-char-accum
- :char-accum-push
- :reset-char-accum
- :empty-char-accum-p
- :make-list-accum
- :list-accum-push
- :reset-list-accum
- :empty-list-accum-p
- :compile-grammar
- :grammar-error
- :meta
- ;; Builtin Type-Checkers
- :alnum?
- :alpha?
- :ascii?
- :bit?
- :digit?
- :extended?
- :graphic?
- :lower?
- :newline?
- :space?
- :tab?
- :upper?
- :white-space?))
+ :defrule
+ :defrenderer
+ :parser-context
+ :parser-context-error
+ :create-parser-context
+ :make-char-accum
+ :char-accum-push
+ :reset-char-accum
+ :empty-char-accum-p
+ :make-list-accum
+ :list-accum-push
+ :reset-list-accum
+ :empty-list-accum-p
+ :compile-grammar
+ :grammar-error
+ :meta
+ ;; Builtin Type-Checkers
+ :alnum?
+ :alpha?
+ :ascii?
+ :bit?
+ :digit?
+ :extended?
+ :graphic?
+ :lower?
+ :newline?
+ :space?
+ :tab?
+ :upper?
+ :white-space?))
35 specials.lisp
View
@@ -0,0 +1,35 @@
+;;; Copyright (c) 2007, Volkan YAZICI <yazicivo@ttnet.net.tr>
+;;; All rights reserved.
+
+;;; Redistribution and use in source and binary forms, with or without
+;;; modification, are permitted provided that the following conditions
+;;; are met:
+
+;;; - Redistributions of source code must retain the above copyright
+;;; notice, this list of conditions and the following disclaimer.
+;;; - Redistributions in binary form must reproduce the above
+;;; copyright notice, this list of conditions and the following
+;;; disclaimer in the documentation and/or other materials provided
+;;; with the distribution.
+
+;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+;;; CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+;;; INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+;;; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+;;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+;;; BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+;;; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+;;; TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+;;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+;;; ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+;;; TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+;;; THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+;;; SUCH DAMAGE.
+
+(in-package :meta-sexp)
+
+(defvar *transformation-rules* (make-hash-table :test 'eq)
+ "Transformation rules to compile meta-sexp grammar.")
+
+(defvar *atom-normalizer* #'char-upcase
+ "Normalizer function to make case-insensitive atom comparison.")
Please sign in to comment.
Something went wrong with that request. Please try again.