Skip to content

Latest commit

 

History

History
426 lines (358 loc) · 14.6 KB

todo.org

File metadata and controls

426 lines (358 loc) · 14.6 KB

syndir: a syntax directed editor

line editor

start with basic console io primitives

render a horizontal sequence of items

implement a cursor that traverses the sequence

hook the cursor up to input events for user interaction

allow inserting, deleting, swapping items in the sequence

make a series of prototypes

parser for meta-grammar

  • regex style syntax
  • deal with [+-?*] suffixes
    • probably not actually a problem but it bothers me
  • decide how to approach precedence

briefly discuss embedding directly in the gerund

  • using gerunds anyway for seq
  • can parse boxed items just as easily as characters
any lit on;:'^([a-z]+\w)|hel.lo*'
  • can’t type raw parens in gerund
  • but the boxed ‘(’ string is fine
    • can use {: }: for grouping
      • if using ;: could have parens translate
    • [`] for charsets
    • +*?|^$ are all valid gerund members
    • boxed string literals
  • can use {. }. for charsets

but:

  • to use this syntax you’re writing a parser for the gerund anyway
  • so why not just parse a string?

builder for j’s sequential machine

  • no point in doing all of pcre since j already has that:

https://www.pcre.org/original/doc/html/pcresyntax.html

“Regular Expression Matching can be Simple and Fast” https://swtch.com/~rsc/regexp/regexp1.html

demo for backreferences / unification

unparser for j parser combinators

enhanced line editor/repl for j statements

  • syntax highlight
  • push/pop parts of the sentence onto a stack
    • swap the items?
  • highlights for trains
  • ’..’ separator support

build a sequential machine / regex thing for j

simplest stackwise concept

  • have a simple jod-like dictionary in the background
  • find all unique J identifiers in the chunk
  • see which ones are undefined
  • allow ‘stub’ entries that name a part of speech

3-pane grammar/editor/ast thing

demonstrate building a grammar interactively

  • import a text file
  • add regexes for tokenizer

JOD browser

list dictionaries show grid of names, with part of speech, documentation expand to see actual definition tiddly/glamorous-style hypertext

get the pl0syntax unparser working

leo-style outliner in j-kvm

simple widget layout language

yaml?

godot-style scene builder ui.

‘extract function’ browser

true tree editor widget

add line editor to edit entries

make the editor part of the tree itself

grid widget / multi-column treegrid thing

  • to be used for the lexer
  • also base for editor with gutter

true multi-line editor widget with selections

demonstrate autocompletion

traditional structure editor

maybe model alice pascal?

unparse a tree

simple outliner

proof editor

begin with a simple proof

   (a^b)^c
eq  a^(b*c) by rExpMul
eq  a^(c*b) by rMulCom
eq (a^c)^b  by rExpMul^:_1

Our goal will be to enter this proof into the system.

a constructor for AST nodes

  • [X] Constructor is a dyad.
  • [X] Left side is always a string. Use (,x) so that rank=1.
  • [X] Right side is always a rank 1 array, so use (,y) too.
  • [X] length of result is always >: 1
  • [X] rank of result is always 1
  • [X] level of result is always >:1
C=:4 :'r=.,x if. #y do. r;,y else. <r end.'

atomic representation of first line

(<'3'C<('3'C<'a'C'^'C'b')C'^'C'c') 5!:0

This is mostly just for reference, because the atomic representation deals with values, not the syntax used to create those values.

unwrapping the first line

derivation

           j:       NB. j:    → n:
           n:       NB. n: $  → n: v: n:
    n:     v: n:    NB. n: v: → (n: v: n:) v:
(n: v: n:) v: n:    NB. substitute
(a  ^  b)  ^  c

tree constructors for the derivation

'`j n v'   =:( 'j:'C])`('n:'C])`('v:'C])   NB. phrases
'`ID NP VP'=:('ID:'C])`('NP:'C])`('VP:'C]) NB. identifiers and
'`CP AP'   =:('CP:'C])`('AP:'C])           NB. primitives
j a:
j < n a:
j <n <(<n a:),(<v a:),(<n a:)
j < n < (<n a:),(<v a:),(<n a:)
j < n < (<n <(<n a:),(<v a:),(<n a:)),(<v a:),(<n a:)

walk the ast to render

walk =: (3 : 'if. 1=#y do. walk each >y elseif. ({.y) e. ID VP NP 0 do. >{: y elseif. do. ;walk each }.y end.')"1
walk ast

– to try —

write tests for tree builder behavior

NOTE . “views” (abstract interface for pattern matching)

wadler 87 https://dl.acm.org/doi/pdf/10.1145/41625.41653 (mentioned in ometa paper)

“Wadler’s views [Wad87], for example, enable programmers to provide a “virtual representation” of their data that can be pattern-matched against without exposing any implementation details”

store the edited text buffer as a rope?

https://en.wikipedia.org/wiki/Rope_%28data_structure%29