24083803b2
(Clear): Finalize vector if it was the last reference. ("&"): Fix Min and Max handling (cut&paste error). (Initialize): Correctly initialize Min to Natural'Last.
Pascal Obry
2002-12-19 18:12:24 +00:00
066f477254
(Filter_Add_Token): Set to upper-case. (Filter_Sub_Token): Idem. (Filter_Mult_Token): Idem. (Filter_Div_Token): Idem. (Filter_Modula_Token): Idem.
Pascal Obry
2002-11-29 22:51:01 +00:00
e13f319fe2
(Image): New routine. (Filter_Plus_Token): New constant. (Filter_Add_Token): New constant. (Filter_Minus_Token): New constant. (Filter_Sub_Token): New constant. (Filter_Multiply_Token): New constant. (Filter_Mult_Token): New constant. (Filter_Divide_Token): New constant. (Filter_Div_Token): New constant. (Filter_Modulo_Token): New constant. (Filters_Mode): Add Plus, Add, Minus, Sub, Multiply, Mult, Divide, Div and Modulo. (Plus_Filter): New routine. (Minus_Filter): New routine. (Divide_Filter): New routine. (Multiply_Filter): New routine. (Modulo_Filter): New routine. (Filter_Table): Add entry for Plus, Add, Minus, Sub, Multiply, Mult, Divide, Div and Modulo. In many places use Image.
Pascal Obry
2002-11-29 22:31:58 +00:00
ffbbb3debe
Minor reformatting.
Pascal Obry
2002-11-28 21:06:37 +00:00
ceb553f2c8
(Attribute): New type. (Tag): Add Attr attribute field. (Image): Handle attribute. (Get_Attribute): New function. (Get_Var_Name): Change to handle attribute. ("+"): Initialize Min/Max matrix field. ("&"): Update Min/Max matrix field. (Initialize): Set Min and Max to 0. (Vect_Size): New rotuine. (Mat_Line): New routine. (Mat_Min_Column): New routine. (Mat_Max_Column): New routine. (Translate): [for a tag], Handle attribute. (Get_Max_Lines.Check): Handle only tag with no atribute. Use matrix's Max field instead of recomputing it here. Minor reformatting.
Pascal Obry
2002-11-28 21:06:12 +00:00
af0da4f768
(Matrix_Tag): Add Min and Max fields. Minor reformatting.
Pascal Obry
2002-11-28 21:05:53 +00:00
82b3767579
(File_Record): Add field to support stream buffered input. Implementation was based on Text_IO but it is now using Stream_IO. (LF_Terminated): New routine. (Get_Line): Implement stream buffered input. More efficient and can now recognized lines terminated with LF. Change implementation of other routines to use Stream_IO instead of Text_IO.
Pascal Obry
2002-10-12 16:49:50 +00:00
5bbbffdfc2
(LF_Terminated): New routine.
Pascal Obry
2002-10-12 16:49:40 +00:00
096cf02fde
(Print_Tree): Text case, do not call New_Line. The new line is now part of the text data. Update copyright notice.
Pascal Obry
2002-10-12 16:49:30 +00:00
5a5b7548f0
(Load): Add Include_File parameter. Call load with Include_File set to True in include case. Add the LF at then end of text line only if needed. (Analyze): Text case, do not add LF at the end of line.
Pascal Obry
2002-10-12 16:49:13 +00:00
f8ce1b0194
(Is_Op): New function. (Is_U_Op): New function. (Image): New routine (for U_Ops). (Value): New routine (for U_Ops). (Parse): Handle U_Op case. (Print_Tree): Handle U_Op case. (Release): Handle U_Op case.
Pascal Obry
2002-10-09 21:28:48 +00:00
c7424481a3
(U_Ops): New type. (Image): New routine (for U_Ops). (Value): New routine (for U_Ops). (NKind): Add U_Op (unary operator). (Node): Handle U_Op. (F_Diff): Add prototype. (U_Ops_Fct): New type. (F_Not): New routine. (U_Op_Table): New variable. (Analyse): Handle U_Op.
Pascal Obry
2002-10-09 21:28:28 +00:00
f20e641d4b
(Image): Add case for O_Diff. (Value): Handle "/=" operator. Support for /= operator.
Pascal Obry
2002-10-09 20:25:44 +00:00
6bdc6f2d97
(Ops): Add O_Diff. (F_Diff): New function. (Analyse.Op_Table): Add entry for O_Diff. Support for /= operator.
Pascal Obry
2002-10-09 20:25:29 +00:00
8b3c60031f
(No_Quote): New function. (Parse): Removes quote around variables and values.
Pascal Obry
2002-08-05 13:23:43 +00:00
70b7a153fe
(Get_Token): If a expression with parenthesis parsed, return parenthesis. (Parse): L_Tok can be an expression (not only a value or variable).
Pascal Obry
2002-08-05 11:07:33 +00:00
68190d369a
Add with Ada.Text_IO.
Pascal Obry
2002-06-22 10:05:51 +00:00
3708f5665c
Remove with Ada.Text_IO. Add unit Templates_Parser.Input. (Load): Use input routines from Templates_Parser.Input instead of Text_IO.
Pascal Obry
2002-06-22 10:05:15 +00:00
19fd658fd3
(Add_Vector): Check that vector is not empty. Fix a bug reported by Dmitriy Anisimkov.
Pascal Obry
2002-03-15 18:44:11 +00:00
55b033904f
Fix minor comment's typo.
Pascal Obry
2002-02-19 21:24:23 +00:00
c23e3d61c2
(Add): If file is not in use, we still want to initialize Old to C_Info node. If tree in use, mark the new tree as not used. (Prot.Get): Now a procedure instead of a function. (Prot.Release): Add assertion. Remove test as this case should never happen. Fix another memory leak in the cache handling.
Pascal Obry
2002-02-18 22:29:10 +00:00
d789b1e1e9
(Prot.Get): Now a procedure instead of a function. (Load): Update to use Prot.Get. Add Assertion. Always set Old to the C_Info node. (Parse): Call analyse on the C_Info tree. Change to fix another memory leak in the cache handling.
Pascal Obry
2002-02-18 22:28:56 +00:00
8640098165
(Add): Always initialize Old with current tree C_Info node. (Get): Returns a static tree. (Release): Parameter is now a Static_Tree. Fix another bug with multitasking programs.
Pascal Obry
2002-02-17 18:31:13 +00:00
a3e960c4cb
(Prot.Release): Parameter is now a Static_Tree. (Prot.Get): Returns a static tree. (Load): Update to use cache interface. (Parse): Idem. Add many comments about cache handling has it is quite tricky piece of code.
Pascal Obry
2002-02-17 18:30:53 +00:00
c499fa936a
(Prot.Add): Add Old parameter. Add many comments, this part is tricky. Do not free a tree that is currently used by another task. (Release): New procedure. (Up_To_Date): Minor reformatting. These changes provides a complete thread safe cache implementation. This is the right fix for the previous check-in.
Pascal Obry
2002-02-17 13:57:37 +00:00
da7fdaf0a8
Handle C_Info node in many places.
Pascal Obry
2002-02-17 13:57:29 +00:00
31c0d65ba8
(Nkind): Add C_Info. (cache info node). (Static_Tree): New type. (Node): Handle C_Info, Add comments. File (Include_Stmt case) is now a Static_Tree. (Prot.Add): Add Old parameter. (Load): Returns now a Static_Tree. Reorder the code to close the file as soon as possible. Build C_Info node. (Print_Tree): Change to support Static_Tree. (Get_Max_Line): Handle C_Info node. (Analyze): Idem. (Parse): Change to handle Static_Tree. (Release): Handle C_Info node. Include_Stmt case handle Static_Tree. These changes provides a complete thread safe cache implementation.
Pascal Obry
2002-02-17 13:57:10 +00:00
0ec8b66e33
(Prot.Add): Check if file is already added. Fix a bug in multithreaded appliations.
Pascal Obry
2002-02-15 21:53:07 +00:00
1b6b394f63
(Mat_List): Do not try to add a vector that does not exist. In the case of a matrix outside a table statement do not add the last LF.
Pascal Obry
2002-01-30 15:33:25 +00:00
3a3e6bc8fa
(Analyze): put the whole exception information into the exception message.
Pascal Obry
2001-11-22 17:47:53 +00:00
c25379f3ea
(Load.Parse): handle better some common errors. (Is_Stmt): is now inlined. Minor reformating.
Pascal Obry
2001-11-08 22:52:18 +00:00
740148c2e6
(Item): Fix bug, advance the index counter.
Pascal Obry
2001-09-11 09:25:28 +00:00
25fbc981e7
(Release): fix bug in freeing the memory.
Pascal Obry
2001-09-03 14:03:35 +00:00
9c940ceb3e
(Item): new function.
Pascal Obry
2001-09-03 14:03:31 +00:00
f5a1bf5218
(Get_All_Parameters): removes trailing ASCII.CR. This fix condition handling when the template has a DOS format and is used under UNIX. (Format_Number_Filter): Trim number. all spaces on the left or right is removed before processing it.
Pascal Obry
2001-07-24 10:12:00 +00:00
ba4afdd129
(Web_Escape_Filter): Handle Web "
Pascal Obry
2001-07-11 14:20:48 +00:00
74020aef36
(End_If_Token): new constant. (Parse_Mode): add Parse_Elsif. (Parse): Implementation of ELSIF token. Add some checks about misplaced @@END_IF@@ and @@END_TABLE@@ statement.
Pascal Obry
2001-06-30 09:07:59 +00:00
fc5ec2121f
(Parameter_Data): new type. (Image): new function to return Parameter_Data string representation. (Filter_Function): use Parameter_Data for parameters. (Filter_Routine): Parameters field is now a Parameter_Data type. (*_Filter): Filters function takes a Parameter_Data object instead of the Unbounded_String one. (Check_Null_Parameter): idem. (Filter_Handle): new function. (Filter_Mode): new function. (Image): for a Tag, use Image for Parameter_Data. (Name_Parameter): change returned value to use new spec based on Parameter_Data. (Expect_Regexp): new function. (Match_Filter): use now the precompiled regexp in Parameter_Data. This is a important speed-up.
Pascal Obry
2001-06-30 08:28:42 +00:00
66efdde793
Put all packages body separate and Print_Tree procedure.
Pascal Obry
2001-06-24 16:48:46 +00:00
a35b0017cc
Initial revision (code separated from main unit).
Pascal Obry
2001-06-24 16:47:47 +00:00
a95578c8c1
(Name_Parameter): correctly handle regexp with parenthesis. (Node): add line information into the node to be able to display line where error occurs during analysis (after parsing). (Match_Filter): check that there is a parameter. (Load): correctly set Line field for each node.
Pascal Obry
2001-06-11 14:44:26 +00:00
c4b22728f8
(Filter_Repeat_Token): new constant. (Filter_Match_Token): new constant. (Filters_Mode): add Match and Repeat. (Filter_Function): add a second parameter. (Filter_Routine): new record. (Filter_Set): is now an array of Filter_Routine. (Check_Null_Parameter): new procedure. (*_Filter): add a second parameter to pass filter's parameters. Check if no parameter are passed. (Image): for tag, display filter parameter. (Get_Filter_Set.Name_Parameter): new function. (Get_Filter_Set): handle filter's parameter. (Repeat_Filter): new function. (Match_Filter): new function. (Filter_Table): add Match and Repeat. Minor reformatting.
Pascal Obry
2001-06-11 12:51:14 +00:00
908cd1b5b0
(Contract_Filter): removes unused variable K. (Translate): if Var is not found we still want to process the registedred filters.
Pascal Obry
2001-05-30 09:47:46 +00:00
83e9d72c5c
Add some comments.
Pascal Obry
2001-05-28 18:57:09 +00:00
c292af0636
(Nkind): add Info into the enumeration. (Node): add case for new Info node. removes File and Filename field from the Include_Stmt case (handled by info node). (Cahced_Files): put Add and Get into a protected record. This package is now thread safe. (Prot): new protected record. (File_Data): removed. (Get): new function. (Add): lot of change to handle case of file already present but reloaded because it has changed on disk. (Get): idem. (Up_To_Date): new function. Check if file has changed on disk or not and if it is needed to reload it. This means a check for the main file and all include files for this file. (Load): Add I_File variable and set it with the list of included files for current loaded file. (Print_Tree): add code to display INFO node. (Get_Max_Lines): handle Info node. (Release): handle Info node.
release-8.0.0
Pascal Obry
2001-05-23 09:29:27 +00:00
4126c08239
(Fatal_Error): add pragma No_Return. Avoid compiler warning. (Get_First_Parameter): handle case where there is only spaces after a tag. (Get_Next_Line): handle case where there is only spaces on a line.
Pascal Obry
2001-05-22 19:04:55 +00:00
9fba1bfd83
(Open_Par): removed. (Close_Par): removed. (Filter_Table): set to constant. (Build_Include_Pathname): new function. (Load): use Build_Include_Pathname when including a template file. This fix a bug when a template in a subdirectory where including another template without specifying a pathname. Minor reformating.
Pascal Obry
2001-05-21 19:34:44 +00:00
2ff9316d12
(Vect_List): moved inside function using it. (Mat_List): idem. Minor reformating.
Pascal Obry
2001-05-16 20:25:05 +00:00
08f8f58f4d
A lot of changes. This new implementation is 2 or 3 times faster than the previous one. (Internal_Error): new exception. (Node): removed filed Has_Tag. (With_Tag): new function. (Filter_*_Token): remove @_ prefix. (Check_Filter): removed. (Through_Filter): removed. (Filter_Length): removed. (Identity_Filter): removed. (Translate): removed. (Filter_Handle): new function. (Filter_Name): new function.
Pascal Obry
2001-05-16 19:49:38 +00:00
23def01f66
(Filter_No_Space_Token): new constant. (Filter_Mode): add No_Space. (No_Space_Filter): new function. Put all filter function in alphabetical order. (Filter_Table): set No_Space entry. (Check_Filter): minor reformating.
Pascal Obry
2001-05-13 18:32:27 +00:00
c84555df14
(Parse): Use Append function to build the results instead of operator &. This avoid a lot of copy to/from the stack and we have a general speed up of a factor 4.
Pascal Obry
2001-05-13 10:53:08 +00:00
05cccd4e09
(Image): Add support for xor condition operator. (Value): Add support for xor condition operator. (Op_Table): add xor in the table. (Ops): add O_Xor. (F_Xor): new function.
Pascal Obry
2001-05-13 10:36:11 +00:00
5ec03be55d
(Begin_Tag): new variable. (End_Tag): new variable. (Filter_*_Token): change start to "@_" (Blank): move to global to share it. (Expr): new package. (Node): add Has_Tag boolean. It is set to True if the line does contains some tag and False otherwise. (Assoc): remove Begin_Tag and End_Tag parameters. (Get_All_Parameters): new function. (Get_First_Parameter): Blank definition removed. (Parse): set Has_Tag field. (Print_Tree): output properly the condition tree for @@IF@@ tag statement. (Analyze): new procedure (to Analyze expression tree). (Translate): set internal variable to new format. (Is_True): new function. (Analyze): use Has_Tag variable to trigger call to Translate. Handle new condition expression. (With_Tag): new function.
Pascal Obry
2001-05-12 18:20:40 +00:00
6ab91af21a
(Set_Tag_Separators): new procedure. (Assoc): remove Begin_Tag and End_Tag parameters. (Default_Begin_Tag): set to "@_" (Default_End_Tag): set to "_@"
Pascal Obry
2001-05-12 18:14:22 +00:00
4721c6fd48
(Filter_Exist_Token): new constant. (Filter_Is_Empty_Token): new constant. (Filter_Mode): add Exist and Is_Empty. (Exist_Filter): new function. (Is_Empty_Filter): new function. (Check): compute now the manimum number of items. (Get_Max): idem. removes check for Natural'Last since now by default if no tag found the result is 0.
Pascal Obry
2001-05-12 08:31:42 +00:00
653d482b3e
(Clear): new procedure. (Initialize): new procedure for Matrix_Tag_Int. (Finalize): idem. (Adjust): idem.
Pascal Obry
2001-05-09 12:25:37 +00:00
81e28f44f5
("+"): new function (Matrix_Tag constructor). ("&"): new function (Matrix_Tag constructor). (Size): new function. (on Matrix_Tag). (Vector): new function. (Assoc): new function (on Matrix_Tag). (Table_State): new type. (Analyse): use Table_State instead of multiple variables. Hanlde properly matrix tag through the table state. (Vect_List): new function. (Mat_List): new function. (Translate): fastest implementation. build properly vector or matrix image outside of TABLE tag statement. Build UP_TABLE_LINE tag value. (Get_Max): complete rewrite to handle properly matrix tag value.
Pascal Obry
2001-05-09 11:13:36 +00:00
3f04e64ead
(Matrix_Tag): new type. (Size): new function. (on Matrix_Tag). (Vector): new function. (Assoc): new function (on Matrix_Tag). (Matrix_Tag_Int): new type. (Var_Kind): add Matrix. (Association): add handling for Matrix.
Pascal Obry
2001-05-09 11:07:04 +00:00
24754434c1
This a complete rewrite of the Templates_Parser engine. Now the file is read into memory and put into a tree. The tree is then analysed to create the resulting file from the templates. This is more dynamic and now an @@IF@@ tag statement inside a @@TABLE@@ tag statement is analysed for each table expansion instead of beeing statically analysed during the first pass. (Max_Section): removed, not more limitation. (Node): new type. (Tree): new type. (Cached_Files): new package. (Size): new function. (Field): return empty string is index too high. (Load): new function. (Print_Tree): new procedure. (Parse): complete rewrite. (Open): removed. (Initialize): for Telmplate_File removed. (Finalize): for Telmplate_File removed. (Adjust): for Telmplate_File removed. Minor comment fixes.
Pascal Obry
2001-05-06 13:31:02 +00:00
b3f2b75077
(Max_Template_Lines): removed. There is no more limitation. (Size): new function. (Parse): Add Cached parameter. Rename Template_Filename to Filename. (Template_File): removed. (Parse): version with Template_File removed. (Open): removed. Minor comment fixes.
Pascal Obry
2001-05-06 13:23:45 +00:00
03a039539c
Add operators "+" for Character, Unbounded_String, Integer and boolean.
release-7.0.0
Pascal Obry
2001-04-28 21:06:00 +00:00
1456bda0c3
("&"): new version for Character, Boolean, Unbounded_String and Integer. (Assoc): new version for Unbounded_String and Integer. (List): fix, return the empty string when there is no element.
Pascal Obry
2001-04-27 21:15:05 +00:00
184d495cd1
("&"): new version for Character, Boolean, Unbounded_String and Integer. (Assoc): new version for Unbounded_String and Integer.
Pascal Obry
2001-04-27 21:14:27 +00:00
a415f9cbaa
("&"): change, now Vector_Tag is a controlled type. ("+"): idem. (Finalize): new procedure (on Vector_Tag type). (Initialize): idem. (Adjust): idem. Minor reformating. Vector_Tas is now a Controlled type to avoid memory leak. Note: this version has no memory leak at all.
Pascal Obry
2001-04-27 19:57:36 +00:00
a07313a48a
Minor reformating. Vector_Tas is now a Controlled type to avoid memory leak.
Pascal Obry
2001-04-27 19:55:57 +00:00
1db5c791ba
Remove with String_Cutter (not used anymore). (Count_Lines): change implementation, was using String_Cutter, use vector tag fields. (Vector_Tag): new type. ("+"): Initial revision. ("&"): Initial revision. (Assoc): new verison for Vector_Tag. Separator is now a string and is used to build list from a vector tag. A vector tag is not anymore a string with separator. (Translate): change implementation, do not use String_Cutter anymore. Reformat.
Pascal Obry
2001-04-26 19:34:58 +00:00
ce5d3d5e2c
(Vector_Tag): new type. ("+"): Initial revision. ("&"): Initial revision. (Assoc): new verison for Vector_Tag. Separator is now a string and is used to build list from a vector tag. A vector tag is not anymore a string with separator. Reformat.
Pascal Obry
2001-04-26 19:32:27 +00:00
d1ad159b09
(Filter_Yes_No_Token): new constant. (Filter_Oui_Non_Token): new constant. (Filter_Mode): add entry for Yes_No and Oui_Non filters. (Yes_No_Filter): new function. (Oui_Non_Filter): new function. (Filter_Table): add entry for above filters. (Check_Filter): minor indentation fix.
Pascal Obry
2000-09-03 18:23:30 +00:00
b2be0331a9
Major changes to implement tag variable filters.
Pascal Obry
2000-02-07 18:23:49 +00:00
68403ca10c
(Translate): fix bug when a empty discrete variable was used in table.
Pascal Obry
1999-12-03 17:59:24 +00:00
9807a736e8
(Translate): new function
Pascal Obry
1999-12-02 21:19:07 +00:00
6892604f56
Minor reformating. Add some comments
Pascal Obry
1999-12-01 16:35:10 +00:00
5f8d651724
(Initialize): new procedure (Finalize): new procedure (Adjust): new procedure (Close): removed. Not needed anymore because the Template_File is controlled.
Pascal Obry
1999-11-30 20:54:07 +00:00
92113fdc52
(Parse, Open, Close): new unit This new version implement the in-memory template file. This way it is possible to cache the template file in a server for better performance.
Pascal Obry
1999-11-30 20:21:27 +00:00
d66adb3446
minor comment added.
Pascal Obry
1999-11-30 18:43:38 +00:00
386214cbe4
(Assoc): add Is_Vector boolean parameter. This must be set to true if we want to build a vector tag. (Translate): add support for tag with a single value in a table.
Pascal Obry
1999-11-25 17:48:07 +00:00
9c2fb0971f
(Assoc): add Is_Vector boolean parameter. This must be set to true if we want to build a vector tag.
Pascal Obry
1999-11-25 17:47:14 +00:00