stuff
This commit is contained in:
@@ -70,6 +70,7 @@ f2f_op(OpStr, Fst) ->
|
|||||||
% never saw the op
|
% never saw the op
|
||||||
f2f_op(_opstr, Stk, []) ->
|
f2f_op(_opstr, Stk, []) ->
|
||||||
lists:reverse(Stk);
|
lists:reverse(Stk);
|
||||||
|
|
||||||
% see op
|
% see op
|
||||||
f2f_op(OpStr, LhsStk, [#tk{str = OpStr} = OpTk | Rest]) ->
|
f2f_op(OpStr, LhsStk, [#tk{str = OpStr} = OpTk | Rest]) ->
|
||||||
Lhf = lists:reverse(LhsStk),
|
Lhf = lists:reverse(LhsStk),
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
-module(gsc_test_ytree).
|
||||||
|
|
||||||
|
-include("$gsc_include/gsc.hrl").
|
||||||
|
|
||||||
|
-export([main/0]).
|
||||||
|
|
||||||
|
|
||||||
|
% @doc ys = syntax stem
|
||||||
|
-record(ys,
|
||||||
|
{tks :: [tk()],
|
||||||
|
sig :: [tk()],
|
||||||
|
mta :: any(),
|
||||||
|
fst :: list(any())}).
|
||||||
|
|
||||||
|
% syntax tree
|
||||||
|
-type yt(StemT, LeafT) :: LeafT
|
||||||
|
| #ys{mta :: StemT,
|
||||||
|
fst :: [yt(StemT, LeafT)]}.
|
||||||
|
|
||||||
|
% syntax forest
|
||||||
|
-type yf(StemT, LeafT) :: [yt(StemT, LeafT)].
|
||||||
|
|
||||||
|
|
||||||
|
main() ->
|
||||||
|
Src = "type foo = bar",
|
||||||
|
io:format("~ts~n", [Src]).
|
||||||
|
|
||||||
Reference in New Issue
Block a user