Changeset 3887


Ignore:
Timestamp:
Jul 28, 2008, 9:34:30 PM (12 years ago)
Author:
yura
Message:
  • Console parser generates $native in both cases.
  • e::t bug fixed.
Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/compiler/FormatMatcher.java

    r3619 r3887  
    100100            return (e instanceof AstSymbol) || (isVar(VarType.S, e));
    101101        } else if (isVar(VarType.T, f)) {
    102             return true;
     102            return !isVar(VarType.E, e) && !isVar(VarType.V, e);
    103103        } else {
    104104            throw new java.lang.IllegalArgumentException();
  • to-imperative/trunk/compiler/refal/org/refal/plus/compiler/rfp_asail_jbc.rf

    r3877 r3887  
    17181718    <IIMVvisitVarInsn <MV> <ALOAD> <Length e.javaArgTypes>>,
    17191719      <IIMVvisitMethodInsn <MV> <INVOKEVIRTUAL> "org/refal/plus/Result" "getExpr" "()Lorg/refal/plus/Expr;">,
    1720       <ConvertRefalToJava e.rfResTypes <ConvertType s.javaResType>>,
     1720      e.rfResTypes : t.rfResTypes1,
     1721      <ConvertRefalToJava t.rfResTypes1 <ConvertType s.javaResType>>,
    17211722      {
    17221723        s.javaResType : \{ "int"; "boolean"; "char"; "byte"; "short"; "int"; } = <IRETURN>;
  • to-imperative/trunk/compiler/refal/org/refal/plus/compiler/rfp_parse.rf

    r3864 r3887  
    6464$table ImplemNames ;
    6565$table FuncDefs ;
     66$table Natives ;
    6667$box TraceNames ;
    6768$box IsTraceall ;
     
    179180  <ClearTable &ImplemNames>,
    180181  <ClearTable &FuncDefs>,
     182  <ClearTable &Natives>,
    181183  <Store &TraceNames>,
    182184  <Store &Current_Module RF t.fileId>,
     
    288290    } :: e.domain (e.undefs),
    289291    e.domain : /*empty*/ =
     292    <Entries &Natives> (/*e.nativesDefs*/) $iter {
     293      e.natives : (((e.pos) (s.WORD_or_QWORD e.funcorigname2)) (e.native)) e.rest =
     294        e.rest (e.nativesDefs <Output_Native (e.pos) (s.WORD_or_QWORD e.funcorigname2) e.native>);
     295    } :: e.natives (e.nativesDefs),
     296    e.natives : /*empty*/ =
    290297    <Map &Check_Trace_Name (<Get &TraceNames>)> : e,
    291     <Lookup_Names e.defs> e.undefs F;
     298    <Lookup_Names e.defs> e.nativesDefs e.undefs F;
    292299};
    293300
     
    422429  <Get_Expected_Token WORD QWORD> :: (e.pos) (s.WORD_or_QWORD e.funcorigname),
    423430  <Get_Expected_Token EQUAL> : e,
    424   <Get_Expected_Token WORD QWORD> :: (e.pos2) (s.type e.value2),
     431  <Get_Expected_Token WORD QWORD> :: (e.pos2) (s.WORD_or_QWORD2 e.funcorigname2),
    425432  <Get_Expected_Token SEMICOLON> : e,
     433  {
     434    <Make_Decl_Name s.WORD_or_QWORD e.funcorigname> : e,
     435      <Bind &FuncDefs ((e.pos) (s.WORD_or_QWORD e.funcorigname)) ((NATIVE e.funcorigname2))>;
     436    <Make_Decl_Name s.WORD_or_QWORD e.funcorigname2> : e,
     437      <Bind &Natives ((e.pos) (s.WORD_or_QWORD e.funcorigname2)) (e.funcorigname)>;
     438    <Add_Error (e.pos) ("Incorrect $native")>;
     439  };
     440
     441Parse_Func_Def // (e.pos) (s.type e.value) = e.items
     442  (e.pos) (s.WORD_or_QWORD e.funcorigname) =
     443//<WriteLN Parse-Func-Def>,
     444  <Parse_Sentence> :: e.items,
     445  <Expect_Token SEMICOLON> : e,
     446  <Bind &FuncDefs ((e.pos) (s.WORD_or_QWORD e.funcorigname)) ((BRANCH <Pragma e.pos> e.items))>;
     447
     448$func Output_Native (e.pos) (s.WORD_or_QWORD e.funcorigname) e.native = t;
     449Output_Native (e.pos) (s.WORD_or_QWORD e.funcorigname) e.native =
    426450  <Make_Decl_Name s.WORD_or_QWORD e.funcorigname> :: s e.qname,
    427451  {
    428452    <Lookup &Names e.qname> :: e.nameinfo =
    429       {
    430         e.nameinfo : (e) (e.origname) e (Def e.def_pos) =
    431           <Add_Error (e.pos) ("Redefenition of function '" e.origname "',")>,
    432           <Add_Error (e.def_pos) ("  previously defined here")>;;
    433       },
    434453      e.nameinfo : (e.pragma_pos) (e.origname) s.declType s.linkage t.in t.out e =
    435454      {
    436455        s.declType : \{ FUNC; "FUNC?"; TFUNC; },
    437           <Bind &Names (e.qname)
    438           ((e.pragma_pos) (e.origname) s.declType s.linkage t.in t.out (Def e.pos))>,
    439456          e.qname s.declType s.linkage t.in t.out <Pragma e.pragma_pos>;
    440457        <Add_Error (e.pos) ("\'" e.origname "\' is not a function,")>,
     
    443460      };
    444461    <Canonical_Word 'Main'> e.qname : s1 e s1,
    445       <Bind &Names (e.qname) ((e.pos) (e.funcorigname) FUNC EXPORT () ((EVAR)) (Def e.pos))>,
    446462      e.qname FUNC EXPORT () ((EVAR)) <Pragma e.pos>;
    447463    <Add_Error (e.pos) ("Undefined name \'" e.funcorigname "\'" )>,
    448       <Bind &Names (e.qname) ((e.pos) (e.funcorigname) FUNC LOCAL ((EVAR)) ((EVAR)) (Def e.pos))>,
    449464      e.qname FUNC LOCAL ((EVAR)) ((EVAR)) <Pragma e.pos>;
    450465  } :: e.qname s.tag s.linkage t.in t.out t.pragma,
    451   {
    452     <Get &IsTraceall> : v =
    453       (TRACE (e.qname));;
    454   } :: e.trace,
    455   {
    456     s.linkage : EXTERN = EXPORT;
    457     s.linkage;
    458   } :: s.linkage,
    459   (s.linkage s.tag t.pragma (e.qname) t.in t.out (NATIVE e.value2))
    460   e.trace;
    461 
    462 Parse_Func_Def // (e.pos) (s.type e.value) = e.items
    463   (e.pos) (s.WORD_or_QWORD e.funcorigname) =
    464 //<WriteLN Parse-Func-Def>,
    465   <Parse_Sentence> :: e.items,
    466   <Expect_Token SEMICOLON> : e,
    467   <Bind &FuncDefs ((e.pos) (s.WORD_or_QWORD e.funcorigname)) ((BRANCH <Pragma e.pos> e.items))>;
     466  (NATIVE s.tag t.pragma (e.qname) t.in t.out e.native);
    468467
    469468Output_Func_Def (e.pos) (s.WORD_or_QWORD e.funcorigname) t.branch =
Note: See TracChangeset for help on using the changeset viewer.