From 9c4519e0c72187f95b6a91e95564ee6a1f45efc7 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 21 Oct 2019 20:09:18 +0200 Subject: psl: add active state. --- src/psl/psl-nfas.adb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/psl/psl-nfas.adb') diff --git a/src/psl/psl-nfas.adb b/src/psl/psl-nfas.adb index 1e3f55ba7..5327f993a 100644 --- a/src/psl/psl-nfas.adb +++ b/src/psl/psl-nfas.adb @@ -30,6 +30,8 @@ package body PSL.NFAs is Start : NFA_State; Final : NFA_State; + Active : NFA_State; + -- If true there is an epsilon transition between the start and -- the final state. Epsilon : Boolean; @@ -208,7 +210,7 @@ package body PSL.NFAs is -- Fill it. Nfat.Table (Res) := (First_State => No_State, Last_State => No_State, - Start => No_State, Final => No_State, + Start | Final | Active => No_State, Epsilon => False); return Res; end Create_NFA; @@ -315,6 +317,16 @@ package body PSL.NFAs is Nfat.Table (N).Final := S; end Set_Final_State; + function Get_Active_State (N : NFA) return NFA_State is + begin + return Nfat.Table (N).Active; + end Get_Active_State; + + procedure Set_Active_State (N : NFA; S : NFA_State) is + begin + Nfat.Table (N).Active := S; + end Set_Active_State; + function Get_Next_Src_Edge (N : NFA_Edge) return NFA_Edge is begin return Transt.Table (N).Next_Src; -- cgit v1.2.3