Changeset 4599

Show
Ignore:
Timestamp:
11/21/08 12:47:26 (7 weeks ago)
Author:
pmoura
Message:

Added an expand_goal/2 built-in method to support explicit calls to the goal_expansion/2 user-defined hook. Updated the term expansion mechanism to allow the expansion to be a single term instead of a list of terms. Improved the documentation of the term and goal expansion predicates.

Added syntax coloring support for the new expand_goal/2 method to the supported text editors and syntax highlighters.

Location:
trunk
Files:
32 modified

Legend:

Unmodified
Added
Removed
  • trunk/compiler/logtalk.pl

    r4598 r4599  
    255255 
    256256:- dynamic('$lgt_pp_hook_term_expansion_'/2).   % '$lgt_pp_hook_term_expansion_'(Term, Terms) 
    257 :- dynamic('$lgt_pp_hook_goal_expansion_'/2).   % '$lgt_pp_hook_goal_expansion_'(Term, Terms) 
     257:- dynamic('$lgt_pp_hook_goal_expansion_'/2).   % '$lgt_pp_hook_goal_expansion_'(Goal, EGoal) 
    258258 
    259259:- dynamic('$lgt_pp_threaded_'/0).              % '$lgt_pp_threaded_' 
     
    17721772        (   Obj == user ->                                          % to speed up entity compilation 
    17731773            TermExpansionGoal = term_expansion(Term, Terms), 
    1774             GoalExpansionGoal = goal_expansion(Term, Terms) 
     1774            GoalExpansionGoal = goal_expansion(Goal, EGoal) 
    17751775        ;   '$lgt_tr_msg'(term_expansion(Term, Terms), Obj, TermExpansionGoal, user), 
    1776             '$lgt_tr_msg'(goal_expansion(Term, Terms), Obj, GoalExpansionGoal, user) 
     1776            '$lgt_tr_msg'(goal_expansion(Goal, EGoal), Obj, GoalExpansionGoal, user) 
    17771777        ), 
    17781778        assertz(('$lgt_pp_hook_term_expansion_'(Term, Terms) :- catch(TermExpansionGoal, _, fail))), 
    1779         assertz(('$lgt_pp_hook_goal_expansion_'(Term, Terms) :- catch(GoalExpansionGoal, _, fail))) 
     1779        assertz(('$lgt_pp_hook_goal_expansion_'(Goal, EGoal) :- catch(GoalExpansionGoal, _, fail))) 
    17801780    ;   true 
    17811781    ). 
     
    29452945 
    29462946 
     2947 
    29472948% '$lgt_term_expansion'(+object_identifier, ?term, ?term, +object_identifier, @scope) 
    29482949% 
     
    29642965            true 
    29652966        ;   call_with_args(DDef, term_expansion(Term, Expansion), Obj, Obj, Obj, Call) 
     2967        ) 
     2968    ), 
     2969    !, 
     2970    once(Call). 
     2971 
     2972 
     2973 
     2974% '$lgt_expand_goal'(+object_identifier, ?term, ?term, +object_identifier, @scope) 
     2975% 
     2976% expand_goal/2 built-in method 
     2977 
     2978'$lgt_expand_goal'(Obj, Goal, Expansion, Sender, Scope) :- 
     2979    (    var(Goal) -> 
     2980         Expansion = Goal 
     2981    ;    '$lgt_goal_expansion'(Obj, Goal, Expand, Sender, Scope) -> 
     2982         Expansion = Expand 
     2983    ;    Expansion = Goal 
     2984    ).  
     2985 
     2986 
     2987 
     2988% '$lgt_goal_expansion'(+object_identifier, ?term, ?term, +object_identifier, @scope) 
     2989% 
     2990% calls the goal_expansion/2 user-defined predicate 
     2991% 
     2992% if there is a scope directive, then the call fails if the sender is not within scope; 
     2993% when there is no scope directive, then we call any local definition when the sender 
     2994% and the target object are the same 
     2995 
     2996'$lgt_goal_expansion'(Obj, Goal, Expansion, Sender, Scope) :- 
     2997    '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, _), 
     2998    (   (   call_with_args(Dcl, goal_expansion(_, _), PScope, _, _, _, _, SCtn, _) -> 
     2999            (   (\+ \+ PScope = Scope; Sender = SCtn) -> 
     3000                call_with_args(Def, goal_expansion(Goal, Expansion), Sender, Obj, Obj, Call, _) 
     3001            ) 
     3002        ) 
     3003    ;   Obj = Sender, 
     3004        (   call_with_args(Def, goal_expansion(Goal, Expansion), Obj, Obj, Obj, Call) -> 
     3005            true 
     3006        ;   call_with_args(DDef, goal_expansion(Goal, Expansion), Obj, Obj, Obj, Call) 
    29663007        ) 
    29673008    ), 
     
    52785319 
    52795320 
    5280 % '$lgt_tr_term'(+term, +integer, @stream, @stream) 
     5321% '$lgt_tr_term'(@term, +integer, @stream, @stream) 
    52815322% 
    52825323% translates a source file term (clauses, directives, and grammar rules) 
     
    52955336 
    52965337 
    5297 % '$lgt_tr_expanded_terms'(+list, +integer, @stream, @stream) 
    5298 % 
    5299 % translates a list of source file terms 
    5300  
    5301 '$lgt_tr_expanded_terms'([], _, _, _). 
     5338% '$lgt_tr_expanded_terms'(@term, +integer, @stream, @stream) 
     5339% 
     5340% translates the expanded terms (which can be a list of terms) 
     5341 
     5342'$lgt_tr_expanded_terms'([], _, _, _) :- 
     5343    !. 
    53025344 
    53035345'$lgt_tr_expanded_terms'([Term| Terms], Line, Input, Output) :- 
     5346    !, 
    53045347    '$lgt_tr_expanded_term'(Term, Line, Input, Output), 
    53055348    '$lgt_tr_expanded_terms'(Terms, Line, Input, Output). 
     5349 
     5350'$lgt_tr_expanded_terms'(Term, Line, Input, Output) :- 
     5351    !, 
     5352    '$lgt_tr_expanded_term'(Term, Line, Input, Output). 
    53065353 
    53075354 
     
    76557702 
    76567703 
    7657 % DCG predicates 
     7704% term and goal expansion predicates 
    76587705 
    76597706'$lgt_tr_body'(expand_term(Term, Clause), '$lgt_expand_term'(This, Term, Clause, This, p(_)), '$lgt_dbg_goal'(expand_term(Term, Clause), '$lgt_expand_term'(This, Term, Clause, This, p(_)), DbgCtx), Ctx) :- 
     
    76617708    '$lgt_ctx_this'(Ctx, This), 
    76627709    '$lgt_ctx_dbg_ctx'(Ctx, DbgCtx). 
     7710 
     7711'$lgt_tr_body'(expand_goal(Goal, EGoal), '$lgt_expand_goal'(This, Goal, EGoal, This, p(_)), '$lgt_dbg_goal'(expand_goal(Goal, EGoal), '$lgt_expand_goal'(This, Goal, EGoal, This, p(_)), DbgCtx), Ctx) :- 
     7712    !, 
     7713    '$lgt_ctx_this'(Ctx, This), 
     7714    '$lgt_ctx_dbg_ctx'(Ctx, DbgCtx). 
     7715 
     7716 
     7717% DCG predicates 
    76637718 
    76647719'$lgt_tr_body'(phrase(GRBody, Input), '$lgt_phrase'(This, GRBody, Input, This, _), '$lgt_dbg_goal'(phrase(GRBody, Input), '$lgt_phrase'(This, GRBody, Input, This, _), DbgCtx), Ctx) :- 
     
    84458500 
    84468501 
    8447 % DCG predicates 
     8502% term and goal expansion predicates 
    84488503 
    84498504'$lgt_tr_msg'(expand_term(Term, Clause), Obj, '$lgt_expand_term'(Obj, Term, Clause, This, p(p(p))), This) :- 
    84508505    !. 
     8506 
     8507'$lgt_tr_msg'(expand_goal(Goal, EGoal), Obj, '$lgt_expand_goal'(Obj, Goal, EGoal, This, p(p(p))), This) :- 
     8508    !. 
     8509 
     8510 
     8511% DCG predicates 
    84518512 
    84528513'$lgt_tr_msg'(phrase(GRBody, List), Obj, '$lgt_phrase'(Obj, GRBody, List, This, p(p(p))), This) :- 
     
    86568717 
    86578718 
    8658  
    8659 % DCG predicates 
     8719% term and goal expansion predicates 
    86608720 
    86618721'$lgt_tr_self_msg'(expand_term(Term, Clause), '$lgt_expand_term'(Self, Term, Clause, This, p(_)), This, Self) :- 
    86628722    !. 
     8723 
     8724'$lgt_tr_self_msg'(expand_goal(Goal, EGoal), '$lgt_expand_goal'(Self, Goal, EGoal, This, p(_)), This, Self) :- 
     8725    !. 
     8726 
     8727 
     8728% DCG predicates 
    86638729 
    86648730'$lgt_tr_self_msg'(phrase(GRBody, List), '$lgt_phrase'(Self, GRBody, List, This, p(_)), This, Self) :- 
     
    1155711623 
    1155811624'$lgt_built_in_method'(expand_term(_, _), p(p(p))). 
     11625'$lgt_built_in_method'(expand_goal(_, _), p(p(p))). 
     11626 
    1155911627'$lgt_built_in_method'(phrase(_, _), p(p(p))). 
    1156011628'$lgt_built_in_method'(phrase(_, _, _), p(p(p))). 
  • trunk/manuals/index.html

    r4575 r4599  
    3232    <div class="copyright"> 
    3333        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/>  
    34         <span>Last updated on: November 7, 2008</span> 
     34        <span>Last updated on: November 21, 2008</span> 
    3535    </div> 
    3636    <div class="navbottom"> 
  • trunk/manuals/refman/index.html

    r4577 r4599  
    294294</dl> 
    295295 
    296 <h3>Term expansion methods</h3> 
     296<h3>Term and goal expansion methods</h3> 
    297297 
    298298<dl class="toc-entries"> 
    299299    <dt><code><a href="methods/expand_term2.html">expand_term/2</a></code><span class="leader"></span><span class="page-ref"><span class="methods_expand_term2"></span></span></dt> 
    300300    <dt><code><a href="methods/term_expansion2.html">term_expansion/2</a></code><span class="leader"></span><span class="page-ref"><span class="methods_term_expansion2"></span></span></dt> 
     301    <dt><code><a href="methods/expand_goal2.html">expand_goal/2</a></code><span class="leader"></span><span class="page-ref"><span class="methods_expand_goal2"></span></span></dt> 
    301302    <dt><code><a href="methods/goal_expansion2.html">goal_expansion/2</a></code><span class="leader"></span><span class="page-ref"><span class="methods_goal_expansion2"></span></span></dt> 
    302303</dl> 
     
    333334    <div class="copyright"> 
    334335        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/>  
    335         <span>Last updated on: November 7, 2008</span> 
     336        <span>Last updated on: November 21, 2008</span> 
    336337    </div> 
    337338    <div class="navbottom"> 
  • trunk/manuals/refman/methods/expand_term2.html

    r3560 r4599  
    2929</p> 
    3030<p> 
    31 The expansion works as follows: if the first argument is a variable, then it is unified with the second argument; if the first argument is not a variable and clauses for the <code>term_expansion/2</code> predicate are within scope, then this predicate is called to provide an expansion that is then unified with the second argument; if the <code>term_expansion/2</code> predicate is not used and the first argument is a compound term with functor <code>--&gt;/2</code> then the default Logtalk grammar rule translator is used, with the resulting clause being unified with the second argument; when the translator is not used, the two arguments are unified. 
     31The expansion works as follows: if the first argument is a variable, then it is unified with the second argument; if the first argument is not a variable and clauses for the <code>term_expansion/2</code> predicate are within scope, then this predicate is called to provide an expansion that is then unified with the second argument; if the <code>term_expansion/2</code> predicate is not used and the first argument is a compound term with functor <code>--&gt;/2</code> then the default Logtalk grammar rule translator is used, with the resulting clause being unified with the second argument; when the translator is not used, the two arguments are unified. The <code>expand_term/2</code> predicate may return a list of terms. 
    3232</p> 
    3333<p> 
     
    5454    <div class="copyright"> 
    5555        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/>  
    56         <span>Last updated on: October 26, 2006</span> 
     56        <span>Last updated on: November 21, 2008</span> 
    5757    </div> 
    5858    <div class="navbottom"> 
  • trunk/manuals/refman/methods/goal_expansion2.html

    r3945 r4599  
    2626<pre>goal_expansion(Goal, ExpandedGoal)</pre> 
    2727<p> 
    28 Defines an expansion for a goal. The first argument is the goal to be expanded. The expanded goal is returned in the second argument. This predicate is called recursively on the expanded goal. Thus, care must be taken to avoid compilation loops. This predicate is called when compiling source files, when dynamically creating new objects, and when asserting predicate clauses.  
     28Defines an expansion for a goal. The first argument is the goal to be expanded. The expanded goal is returned in the second argument. This predicate is called recursively on the expanded goal. Thus, care must be taken to avoid compilation loops. This predicate, when defined, is automatically called by the <a href="expand_goal2.html"><code>expand_goal/2</code></a> method. Use of this predicate by the <code>expand_goal/2</code> method may be restricted by using a scope directive for it. This predicate is called when compiling source files, when dynamically creating new objects, and when asserting predicate clauses.  
    2929</p> 
    3030 
     
    4848    <div class="copyright"> 
    4949        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/>  
    50         <span>Last updated on: December 3, 2007</span> 
     50        <span>Last updated on: November 21, 2008</span> 
    5151    </div> 
    5252    <div class="navbottom"> 
    53         <span><a href="term_expansion2.html">previous</a> | <a href="../../glossary.html">glossary</a> | <a href="../index.html#methods">next</a></span><br/> 
     53        <span><a href="expand_goal2.html">previous</a> | <a href="../../glossary.html">glossary</a> | <a href="../index.html#methods">next</a></span><br/> 
    5454        <span><a href="http://validator.w3.org/check/referer">XHTML</a> + <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></span> 
    5555    </div> 
  • trunk/manuals/refman/methods/term_expansion2.html

    r3942 r4599  
    2626<pre>term_expansion(Term, Expansion)</pre> 
    2727<p> 
    28 Defines an expansion for a term. This predicate, when defined, is automatically called by the <a href="expand_term2.html"><code>expand_term/2</code></a> method. Use of this predicate by the <code>expand_term/2</code> method may be restricted by using a scope directive for it. The <code>term_expansion/2</code> clauses are only used by the <code>expand_term/2</code> method if they are within the scope of the <em>sender</em>. When that is not the case, the <code>expand_term/2</code> method only uses the default expansions. 
     28Defines an expansion for a term. This predicate, when defined, is automatically called by the <a href="expand_term2.html"><code>expand_term/2</code></a> method. Use of this predicate by the <code>expand_term/2</code> method may be restricted by using a scope directive for it. The <code>term_expansion/2</code> clauses are only used by the <code>expand_term/2</code> method if they are within the scope of the <em>sender</em>. When that is not the case, the <code>expand_term/2</code> method only uses the default expansions. The <code>term_expansion/2</code> predicate may return a list of terms. 
    2929</p> 
    3030 
     
    4848    <div class="copyright"> 
    4949        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/>  
    50         <span>Last updated on: October 26, 2006</span> 
     50        <span>Last updated on: November 21, 2008</span> 
    5151    </div> 
    5252    <div class="navbottom"> 
    53         <span><a href="expand_term2.html">previous</a> | <a href="../../glossary.html">glossary</a> | <a href="goal_expansion2.html">next</a></span><br/> 
     53        <span><a href="expand_term2.html">previous</a> | <a href="../../glossary.html">glossary</a> | <a href="expand_goal2.html">next</a></span><br/> 
    5454        <span><a href="http://validator.w3.org/check/referer">XHTML</a> + <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></span> 
    5555    </div> 
  • trunk/manuals/refman/refman.header

    r4575 r4599  
    3636        <span>http://logtalk.org/</span> 
    3737    </p> 
    38     <p class="date">Last updated on November 7, 2008</p> 
     38    <p class="date">Last updated on November 21, 2008</p> 
    3939</div> 
    4040 
  • trunk/manuals/userman/index.html

    r4576 r4599  
    171171        <dd><a href="predicates.html#predicates_reflection">Reflection methods</a><span class="leader"></span><span class="page-ref"><span class="predicates_reflection"></span></span></dd> 
    172172        <dd><a href="predicates.html#predicates_parsing">Definite clause grammar parsing methods</a><span class="leader"></span><span class="page-ref"><span class="predicates_parsing"></span></span></dd> 
    173         <dd><a href="predicates.html#predicates_expanding">Term expansion methods</a><span class="leader"></span><span class="page-ref"><span class="predicates_expanding"></span></span></dd> 
     173        <dd><a href="predicates.html#predicates_expanding">Term and goal expansion methods</a><span class="leader"></span><span class="page-ref"><span class="predicates_expanding"></span></span></dd> 
    174174    <dt><a href="predicates.html#predicates_properties">Predicate properties</a><span class="leader"></span><span class="page-ref"><span class="predicates_properties"></span></span></dt> 
    175175    <dt><a href="predicates.html#predicates_finding">Finding declared predicates</a><span class="leader"></span><span class="page-ref"><span class="predicates_finding"></span></span></dt> 
     
    299299    <div class="copyright"> 
    300300        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/> 
    301         <span>Last updated on: November 7, 2008</span> 
     301        <span>Last updated on: November 21, 2008</span> 
    302302    </div> 
    303303    <div class="navbottom"> 
  • trunk/manuals/userman/predicates.html

    r4530 r4599  
    584584</p> 
    585585 
    586 <h3 id="predicates_expanding">Term expansion methods</h3> 
    587  
    588 <p> 
    589 Logtalk supports a <a title="Consult reference manual" href="../refman/methods/expand_term2.html"><code>expand_term/2</code></a> built-in method for expanding a term into another. This method is mostly used to translate grammar rules into Prolog clauses. It can be customized, e.g. for bypassing the default Logtalk grammar rule translator, by defining clause for the predicate <a title="Consult reference manual" href="../refman/methods/term_expansion2.html"><code>term_expansion/2</code></a>. 
     586<h3 id="predicates_expanding">Term and goal expansion methods</h3> 
     587 
     588<p> 
     589Logtalk supports a <a title="Consult reference manual" href="../refman/methods/expand_term2.html"><code>expand_term/2</code></a> built-in method for expanding a term into a list of terms. This method is mostly used to translate grammar rules into Prolog clauses. It can be customized, e.g. for bypassing the default Logtalk grammar rule translator, by defining clause for the predicate <a title="Consult reference manual" href="../refman/methods/term_expansion2.html"><code>term_expansion/2</code></a>. 
     590</p> 
     591<p> 
     592Logtalk supports a <a title="Consult reference manual" href="../refman/methods/expand_goal2.html"><code>expand_goal/2</code></a> built-in method for expanding a goal. This method can be customized by defining clause for the predicate <a title="Consult reference manual" href="../refman/methods/goal_expansion2.html"><code>goal_expansion/2</code></a>. 
    590593</p> 
    591594 
     
    679682    <div class="copyright"> 
    680683        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/>  
    681         <span>Last updated on: October 20, 2008</span> 
     684        <span>Last updated on: November 21, 2008</span> 
    682685    </div> 
    683686    <div class="navbottom"> 
  • trunk/manuals/userman/userman.header

    r4576 r4599  
    3636        <span>http://logtalk.org/</span> 
    3737    </p> 
    38     <p class="date">Last updated on November 7, 2008</p> 
     38    <p class="date">Last updated on November 21, 2008</p> 
    3939</div> 
    4040 
  • trunk/RELEASE_NOTES.txt

    r4598 r4599  
    2424    compilation of Prolog specific code. 
    2525 
     26    Added an expand_goal/2 built-in method to support explicit calls to the 
     27    goal_expansion/2 user-defined hook. Updated the term expansion mechanism 
     28    to allow the expansion to be a single term instead of a list of terms. 
     29    Improved the documentation of the term and goal expansion predicates. 
     30 
    2631    Simplified the implementation of the threaded/1 built-in predicate. 
    2732 
     
    5863    Prolog compilers. 
    5964 
    60     Added syntax coloring support for the new conditional compilation 
    61     directives to the supported text editors and syntax highlighters. 
     65    Added syntax coloring support for the new expand_goal/2 method and for the 
     66    new conditional compilation directives to the supported text editors and  
     67    syntax highlighters. 
    6268 
    6369    Fixed a block comment syntax coloring bug in the support for the Highlight 
  • trunk/wenv/emacs/logtalk.el

    r4582 r4599  
    55;; Author: Paulo Moura <pmoura@logtalk.org> 
    66;; Creation date: November 15, 2003 
    7 ;; Last modification date: November 8, 2008 
    8 ;; Version: 1.5 
     7;; Last modification date: November 21, 2008 
     8;; Version: 1.6 
    99 
    1010;; Installation: 
     
    114114        ("\\<\\(bagof\\|f\\(?:\\(?:ind\\|or\\)all\\)\\|setof\\)\\([(]\\)" 1 'logtalk-built-in-method-face) 
    115115        ("\\<\\(after\\|before\\)\\([(]\\)" 1 'logtalk-built-in-method-face) 
    116         ("\\<\\(phrase\\|expand_term\\|\\(?:goal\\|term\\)_expansion\\)\\([(]\\)" 1 'logtalk-built-in-method-face) 
     116        ("\\<\\(phrase\\|expand_\\(?:goal\\|term\\)\\|\\(?:goal\\|term\\)_expansion\\)\\([(]\\)" 1 'logtalk-built-in-method-face) 
    117117    )) 
    118118 
  • trunk/wenv/geshi/logtalk.php

    r4582 r4599  
    1313 * 
    1414 * Based on GeSHi release 1.0.7.21 
    15  * Last Change: November 8, 2008 
     15 * Last Change: November 21, 2008 
    1616 * 
    1717 ************************************************************************************* 
     
    185185            //DCGs and term expansion 
    186186        7 => array( 
    187                     GESHI_SEARCH => '(phrase|expand_term|((goal|term)_expansion))(?=[(])', 
     187                    GESHI_SEARCH => '(phrase|expand_(goal|term)|((goal|term)_expansion))(?=[(])', 
    188188                    GESHI_REPLACE => '\\1', 
    189189                    GESHI_MODIFIERS => '', 
  • trunk/wenv/gtksourceview2/logtalk.lang

    r4585 r4599  
    146146            <keyword>(after)(?=[(])</keyword> 
    147147            <!-- DCGs --> 
    148             <keyword>(expand_term)(?=[(])</keyword> 
     148            <keyword>(expand_(goal|term))(?=[(])</keyword> 
    149149            <keyword>((goal|term)_expansion)(?=[(])</keyword> 
    150150            <keyword>(phrase)(?=[(])</keyword> 
  • trunk/wenv/highlight/lgt.lang

    r4587 r4599  
    55#  Author: Paulo Moura 
    66#    Mail: pmoura@logtalk.org 
    7 #    Date: 11.11.08 
    8 # Version: 1.2 
     7#    Date: 21.11.08 
     8# Version: 1.3 
    99# ------------------------------------------ 
    1010# This file is a part of highlight, a free source code converter released under the GPL. 
     
    3838$KEYWORDS(kwc)=regex((current_predicate|predicate_property)(?=[(]), 1) 
    3939# DCGs 
    40 $KEYWORDS(kwc)=regex((expand_term|(?:goal|term)_expansion|phrase)(?=[(]), 1) 
     40$KEYWORDS(kwc)=regex((expand_(goal|term))(?=[(]), 1) 
     41$KEYWORDS(kwc)=regex(((?:goal|term)_expansion|phrase)(?=[(]), 1) 
    4142# entity 
    4243$KEYWORDS(kwc)=regex(((abolish|c(reate|urrent))_(object|protocol|category))(?=[(]), 1) 
  • trunk/wenv/jedit/logtalk.xml

    r4582 r4599  
    66 
    77    written by      Paulo Moura 
    8     version         1.6 
     8    version         1.7 
    99    created on      5 May 2002 
    10     last revised    8 November 2008 
     10    last revised    21 November 2008 
    1111 
    1212    To install, copy this file to the "modes" subdirectory in jEdit  
     
    6363        <SEQ_REGEXP AT_WORD_START="TRUE" TYPE="KEYWORD2">\b(current_predicate|predicate_property)(?=[(])</SEQ_REGEXP> 
    6464        <!-- DCGs --> 
    65         <SEQ_REGEXP AT_WORD_START="TRUE" TYPE="KEYWORD2">\b(expand_term|(goal|term)_expansion|phrase)(?=[(])</SEQ_REGEXP> 
     65        <SEQ_REGEXP AT_WORD_START="TRUE" TYPE="KEYWORD2">\b(expand_(goal|term)|(goal|term)_expansion|phrase)(?=[(])</SEQ_REGEXP> 
    6666        <!-- Entity --> 
    6767        <SEQ_REGEXP AT_WORD_START="TRUE" TYPE="KEYWORD2">\b(abolish|c(reate|urrent))_(object|protocol|category)(?=[(])</SEQ_REGEXP> 
  • trunk/wenv/kate/logtalk.xml

    r4583 r4599  
    22<!DOCTYPE language SYSTEM "language.dtd"> 
    33 
    4 <language name="Logtalk" version="2.2" kateversion="2.4" section="Sources" extensions="*.lgt;*.config" mimetype="text/x-logtalk" author="Paulo Moura (pmoura@logtalk.org)" license="Artistic License 2.0"> 
     4<language name="Logtalk" version="2.3" kateversion="2.4" section="Sources" extensions="*.lgt;*.config" mimetype="text/x-logtalk" author="Paulo Moura (pmoura@logtalk.org)" license="Artistic License 2.0"> 
    55 
    66    <highlighting> 
     
    1818                <RegExpr String = "\b(current_predicate|predicate_property)(?=[(])" attribute = "Built-in" context = "#stay" /> 
    1919                <!-- DCGs --> 
    20                 <RegExpr String = "\b(expand_term|(goal|term)_expansion|phrase)(?=[(])" attribute = "Built-in" context = "#stay" /> 
     20                <RegExpr String = "\b(expand_(goal|term)|(goal|term)_expansion|phrase)(?=[(])" attribute = "Built-in" context = "#stay" /> 
    2121                <!-- Entity --> 
    2222                <RegExpr String = "\b(abolish|c(reate|urrent))_(object|protocol|category)(?=[(])" attribute = "Built-in" context = "#stay" /> 
  • trunk/wenv/nedit/logtalk.pats

    r4582 r4599  
    33! Author: Paulo Moura (pmoura at logtalk.org) 
    44! 
    5 ! Last changed in: November 8, 2008 
     5! Last changed in: November 21, 2008 
    66! 
    77! 
     
    4545    Quoted atoms:"'":"'"::String::\n\ 
    4646    Escape sequences:"\\\\([\\\\abfnrtv""']|(x[a-fA-F0-9]+|[0-7]+)\\\\)":::String1:Quoted atoms:\n\ 
    47     Built-in methods:"<(parameter|self|sender|this|current_predicate|predicate_property|abolish|asserta|assertz|clause|retractall|retract|bagof|findall|forall|setof|before|after|expand_term|goal_expansion|term_expansion|phrase|threaded|threaded_call|threaded_once|threaded_ignore|threaded_exit|threaded_peek|threaded_wait|threaded_notify)(?=[(])":::Subroutine::\n\ 
     47    Built-in methods:"<(parameter|self|sender|this|current_predicate|predicate_property|abolish|asserta|assertz|clause|retractall|retract|bagof|findall|forall|setof|before|after|expand_goal|expand_term|goal_expansion|term_expansion|phrase|threaded|threaded_call|threaded_once|threaded_ignore|threaded_exit|threaded_peek|threaded_wait|threaded_notify)(?=[(])":::Subroutine::\n\ 
    4848    Arithmetic operators:"<is>|\\+|\\*|\\-|/|=:=|=\\\\=|=\\<|\\>=|\\<|\\>":::Subroutine::\n\ 
    4949    Built-in predicates:"<(current_object|current_protocol|current_category|create_object|create_protocol|create_category|object_property|protocol_property|category_property|abolish_object|abolish_protocol|abolish_category|complements_object|extends_object|extends_protocol|extends_category|implements_protocol|instantiates_class|specializes_class|imports_category|abolish_events|current_event|define_events|current_logtalk_flag|set_logtalk_flag|logtalk_compile|logtalk_load|logtalk_library_path|forall|retractall)(?=[(])":::Subroutine::\n\ 
  • trunk/wenv/npp/logtalk.api

    r4582 r4599  
    6060end_protocol 
    6161exp 
     62expand_goal 
    6263expand_term 
    6364extends 
  • trunk/wenv/pygments/logtalk.py

    r4582 r4599  
    5050            (r'(current_predicate|predicate_property)(?=[(])', Keyword), 
    5151            # DCGs and term expansion 
    52             (r'(expand_term|(goal|term)_expansion|phrase)(?=[(])', Keyword), 
     52            (r'(expand_(goal|term)|(goal|term)_expansion|phrase)(?=[(])', Keyword), 
    5353            # Entity 
    5454            (r'(abolish|c(reate|urrent))_(object|protocol|category)(?=[(])', Keyword),