Commit 195c155c authored by claes's avatar claes

ohTime, rbTime and dbTime in wb_load files and orep, classversion modified

parent 0f3466cd
/**
* Proview $Id: wb_bdrep.cpp,v 1.15 2005-09-01 14:57:57 claes Exp $
* Proview $Id: wb_bdrep.cpp,v 1.16 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -298,3 +298,8 @@ wb_name wb_bdrep::longName() const
{
return m_orep->longName();
}
pwr_tTime wb_bdrep::modTime()
{
return m_orep->treeModTime();
}
/**
* Proview $Id: wb_bdrep.h,v 1.12 2005-09-01 14:57:57 claes Exp $
* Proview $Id: wb_bdrep.h,v 1.13 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -58,7 +58,7 @@ public:
wb_adrep *super( pwr_tStatus *sts);
pwr_tStatus sts() { return m_sts;}
pwr_tTime modTime();
};
......
/**
* Proview $Id: wb_cdrep.cpp,v 1.25 2005-09-01 14:57:57 claes Exp $
* Proview $Id: wb_cdrep.cpp,v 1.26 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -18,6 +18,7 @@
**/
#include "co_cdh.h"
#include "co_time.h"
#include "wb_cdrep.h"
#include "wb_erep.h"
#include "wb_merep.h"
......@@ -450,6 +451,32 @@ pwr_tTime wb_cdrep::ohTime()
return m_orep->ohTime();
}
pwr_tTime wb_cdrep::modTime()
{
return m_orep->treeModTime();
}
pwr_tTime wb_cdrep::structModTime()
{
pwr_tStatus sts;
pwr_tTime t = m_orep->modTime();
wb_bdrep *rbd = bdrep( &sts, pwr_eBix_rt);
if ( ODD(sts)) {
pwr_tTime rbt = rbd->modTime();
if ( time_Acomp( &rbt, &t) == 1)
t = rbt;
delete rbd;
}
wb_bdrep *dbd = bdrep( &sts, pwr_eBix_dev);
if ( ODD(sts)) {
pwr_tTime dbt = dbd->modTime();
if ( time_Acomp( &dbt, &t) == 1)
t = dbt;
}
return t;
}
wb_cdrep* wb_cdrep::super( pwr_tStatus *sts)
{
wb_bdrep *bd = bdrep( sts, pwr_eBix_rt);
......@@ -759,5 +786,9 @@ void wb_cdrep::updateTemplate( pwr_eBix bix, void *b, pwr_tOid oid, pwr_tOid toi
delete bd;
}
ldh_eVolRep wb_cdrep::vtype() const
{
return m_orep->vtype();
}
/**
* Proview $Id: wb_cdrep.h,v 1.19 2005-09-01 14:57:57 claes Exp $
* Proview $Id: wb_cdrep.h,v 1.20 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -76,6 +76,8 @@ public:
wb_orep *menuFirst( pwr_tStatus *sts, wb_orep *orep, void **o);
pwr_tTime ohTime();
pwr_tTime modTime();
pwr_tTime structModTime();
void convertSubClass( pwr_tCid cid, wb_merep *merep,
void *body_source, void *body_target);
void convertObject( wb_merep *merep, void *rbody, void *dbody,
......@@ -86,6 +88,7 @@ public:
pwr_tOid toid);
void updateTemplate( pwr_eBix bix, void *b, pwr_tOid oid, pwr_tOid toid);
pwr_tStatus sts() { return m_sts;}
ldh_eVolRep vtype() const;
};
#endif
......
/**
* Proview $Id: wb_ldh.cpp,v 1.43 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_ldh.cpp,v 1.44 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -2055,6 +2055,17 @@ ldh_GetSubClass(ldh_tSession session, pwr_tCid supercid, pwr_tCid subcid, pwr_tC
return sp->sts();
}
pwr_tStatus
ldh_GetModTime(ldh_tSession session, pwr_tOid oid, pwr_tTime *time)
{
wb_session *sp = (wb_session *)session;
wb_object o = sp->object(oid);
if (!o) return o.sts();
*time = o.modTime();
return o.sts();
}
#endif
......@@ -2062,3 +2073,4 @@ ldh_GetSubClass(ldh_tSession session, pwr_tCid supercid, pwr_tCid subcid, pwr_tC
/**
* Proview $Id: wb_ldh.h,v 1.25 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_ldh.h,v 1.26 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -1175,6 +1175,13 @@ ldh_GetSubClass(
pwr_tCid *nextsubcid
);
pwr_tStatus
ldh_GetModTime(
ldh_tSession session,
pwr_tOid oid,
pwr_tTime *time
);
#ifdef __cplusplus
}
#endif
......
/**
* Proview $Id: wb_merep.cpp,v 1.29 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_merep.cpp,v 1.30 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -364,6 +364,13 @@ void wb_merep::classVersion( pwr_tStatus *sts, pwr_tCid cid, pwr_tTime *time)
wb_cdrep *cd = cdrep( sts, cid);
if ( !cd) return;
if ( cd->vtype() == ldh_eVolRep_Dbs) {
// ohTime contains class version for a class in vrepdbs
*time = cd->ohTime();
*sts = LDH__SUCCESS;
return;
}
wb_bdrep *bd = cd->bdrep( sts, pwr_eBix_rt);
if ( !bd) {
delete cd;
......@@ -375,7 +382,7 @@ void wb_merep::classVersion( pwr_tStatus *sts, pwr_tCid cid, pwr_tTime *time)
return;
}
*time = cd->ohTime();
*time = cd->structModTime();
wb_adrep *ad, *oad;
for ( ad = bd->adrep( sts); ad;) {
......
/**
* Proview $Id: wb_object.cpp,v 1.13 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_object.cpp,v 1.14 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -290,6 +290,34 @@ pwr_tTime wb_object::ohTime()
return m_orep->ohTime();
}
pwr_tTime wb_object::rbTime()
{
check();
return m_orep->rbTime();
}
pwr_tTime wb_object::dbTime()
{
check();
return m_orep->dbTime();
}
pwr_tTime wb_object::modTime()
{
check();
return m_orep->modTime();
}
pwr_tTime wb_object::treeModTime()
{
check();
return m_orep->treeModTime();
}
pwr_mClassDef wb_object::flags()
{
check();
......
/**
* Proview $Id: wb_object.h,v 1.12 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_object.h,v 1.13 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -82,9 +82,11 @@ public:
const char *name();
wb_name longName();
pwr_tTime ohTime(); //< time when this object was last changed
pwr_tTime ohTime(); //< time when header of this object was last changed
pwr_tTime rbTime(); //< time when run time body of this object was last changed
pwr_tTime dbTime(); //< time when development body of this object was last changed
pwr_tTime modTime(); //< time when this object was last changed
pwr_tTime treeModTime(); //< time when this object or any ancestor was last changed
pwr_mClassDef flags();
......
/**
* Proview $Id: wb_orep.cpp,v 1.5 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orep.cpp,v 1.6 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -18,6 +18,7 @@
**/
#include "wb_orep.h"
#include "co_time.h"
wb_orep::wb_orep() : m_nRef(0)
{
......@@ -37,3 +38,38 @@ wb_orep *wb_orep::ref()
m_nRef++;
return this;
}
pwr_tTime wb_orep::modTime()
{
pwr_tTime t = ohTime();
pwr_tTime rbt = rbTime();
pwr_tTime dbt = dbTime();
if ( time_Acomp( &rbt, &t) == 1)
t = rbt;
if ( time_Acomp( &dbt, &rbt) == 1)
t = dbt;
return t;
}
pwr_tTime wb_orep::treeModTime()
{
pwr_tStatus sts;
pwr_tTime t = modTime();
pwr_tTime tchild;
wb_orep *after;
for ( wb_orep *child = first( &sts);
ODD(sts);
child = after) {
child->ref();
tchild = child->treeModTime();
if ( time_Acomp( &tchild, &t) == 1)
t = tchild;
after = child->after( &sts);
child->unref();
}
return t;
}
/**
* Proview $Id: wb_orep.h,v 1.12 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orep.h,v 1.13 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -62,6 +62,8 @@ public:
virtual const char * name() const = 0;
virtual wb_name longName() = 0;
virtual pwr_tTime ohTime() const = 0;
virtual pwr_tTime rbTime() const = 0;
virtual pwr_tTime dbTime() const = 0;
virtual pwr_mClassDef flags() const = 0;
virtual bool isOffspringOf(const wb_orep *o) const = 0;
......@@ -85,6 +87,10 @@ public:
virtual wb_erep *erep() const = 0;
virtual wb_vrep *vrep() const = 0;
virtual ldh_eVolRep vtype() const = 0;
pwr_tTime modTime();
pwr_tTime treeModTime();
};
#endif
/**
* Proview $Id: wb_orepdb.cpp,v 1.9 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepdb.cpp,v 1.10 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -133,6 +133,20 @@ pwr_tTime wb_orepdb::ohTime() const
return m_vrep->ohTime(&sts, (wb_orep*)this);
}
pwr_tTime wb_orepdb::rbTime() const
{
pwr_tStatus sts;
return m_vrep->rbTime(&sts, (wb_orep*)this);
}
pwr_tTime wb_orepdb::dbTime() const
{
pwr_tStatus sts;
return m_vrep->dbTime(&sts, (wb_orep*)this);
}
pwr_mClassDef wb_orepdb::flags() const
{
pwr_tStatus sts;
......
/**
* Proview $Id: wb_orepdb.h,v 1.10 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepdb.h,v 1.11 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -55,6 +55,8 @@ public:
virtual const char * name() const;
virtual wb_name longName();
virtual pwr_tTime ohTime() const;
virtual pwr_tTime rbTime() const;
virtual pwr_tTime dbTime() const;
virtual pwr_mClassDef flags() const;
virtual bool isOffspringOf(const wb_orep *o) const;
......@@ -76,6 +78,7 @@ public:
wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;}
virtual ldh_eVolRep vtype() const { return ldh_eVolRep_Db;}
};
#endif
/**
* Proview $Id: wb_orepdbs.cpp,v 1.14 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepdbs.cpp,v 1.15 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -156,6 +156,16 @@ pwr_tTime wb_orepdbs::ohTime() const
return m_o->time;
}
pwr_tTime wb_orepdbs::rbTime() const
{
return m_o->rbody.time;
}
pwr_tTime wb_orepdbs::dbTime() const
{
return m_o->dbody.time;
}
pwr_mClassDef wb_orepdbs::flags() const
{
return m_o->ohFlags;
......
/**
* Proview $Id: wb_orepdbs.h,v 1.14 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepdbs.h,v 1.15 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -58,6 +58,8 @@ public:
virtual const char * name() const;
virtual wb_name longName();
virtual pwr_tTime ohTime() const;
virtual pwr_tTime rbTime() const;
virtual pwr_tTime dbTime() const;
virtual pwr_mClassDef flags() const;
virtual bool isOffspringOf(const wb_orep *o) const;
......@@ -79,6 +81,7 @@ public:
wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;}
virtual ldh_eVolRep vtype() const { return ldh_eVolRep_Dbs;}
dbs_sObject *o() const { return m_o;}
......
/**
* Proview $Id: wb_orepext.cpp,v 1.2 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepext.cpp,v 1.3 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -89,8 +89,17 @@ wb_name wb_orepext::longName()
pwr_tTime wb_orepext::ohTime() const
{
pwr_tTime t = {0,0};
return t;
return m_extobject.time;
}
pwr_tTime wb_orepext::rbTime() const
{
return m_extobject.time;
}
pwr_tTime wb_orepext::dbTime() const
{
return m_extobject.time;
}
pwr_mClassDef wb_orepext::flags() const
......
/**
* Proview $Id: wb_orepext.h,v 1.2 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepext.h,v 1.3 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -53,6 +53,8 @@ public:
virtual const char * name() const;
virtual wb_name longName();
virtual pwr_tTime ohTime() const;
virtual pwr_tTime rbTime() const;
virtual pwr_tTime dbTime() const;
virtual pwr_mClassDef flags() const;
virtual bool isOffspringOf(const wb_orep *o) const;
......@@ -75,6 +77,7 @@ public:
wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;}
virtual ldh_eVolRep vtype() const { return ldh_eVolRep_Ext;}
virtual bool docBlock( char **block, int *size) const { return false;}
virtual bool docBlock( char *block) { return false;}
......
/**
* Proview $Id: wb_orepmem.cpp,v 1.4 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepmem.cpp,v 1.5 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -103,8 +103,17 @@ wb_name wb_orepmem::longName()
pwr_tTime wb_orepmem::ohTime() const
{
pwr_tTime t = {0,0};
return t;
return m_memobject->m_ohtime;
}
pwr_tTime wb_orepmem::rbTime() const
{
return m_memobject->m_rbtime;
}
pwr_tTime wb_orepmem::dbTime() const
{
return m_memobject->m_dbtime;
}
pwr_mClassDef wb_orepmem::flags() const
......
/**
* Proview $Id: wb_orepmem.h,v 1.4 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepmem.h,v 1.5 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -54,6 +54,8 @@ public:
virtual const char * name() const;
virtual wb_name longName();
virtual pwr_tTime ohTime() const;
virtual pwr_tTime rbTime() const;
virtual pwr_tTime dbTime() const;
virtual pwr_mClassDef flags() const;
virtual bool isOffspringOf(const wb_orep *o) const;
......@@ -78,6 +80,7 @@ public:
wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;}
virtual ldh_eVolRep vtype() const { return ldh_eVolRep_Mem;}
virtual bool docBlock( char **block, int *size) const;
virtual bool docBlock( char *block);
......
/**
* Proview $Id: wb_orepref.h,v 1.2 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepref.h,v 1.3 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -55,6 +55,8 @@ public:
return wb_name( str);
}
virtual pwr_tTime ohTime() const { pwr_tTime t = {0,0}; return t;}
virtual pwr_tTime rbTime() const { pwr_tTime t = {0,0}; return t;}
virtual pwr_tTime dbTime() const { pwr_tTime t = {0,0}; return t;}
virtual pwr_mClassDef flags() const { pwr_mClassDef m; m.m = 0; return m;}
virtual bool isOffspringOf(const wb_orep *o) const {return false;}
......@@ -71,6 +73,7 @@ public:
virtual wb_adrep *attribute(pwr_tStatus *sts) {*sts = LDH__NOSUCHOBJ; return 0;}
wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;}
virtual ldh_eVolRep vtype() const { return ldh_eVolRep_Ref;}
virtual bool docBlock( char **block, int *size) const {return false;}
virtual bool docBlock( char *block) {return false;}
......
/**
* Proview $Id: wb_orepwbl.cpp,v 1.11 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepwbl.cpp,v 1.12 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -103,7 +103,19 @@ wb_name wb_orepwbl::longName()
pwr_tTime wb_orepwbl::ohTime() const
{
return m_wblnode->getFileTime();
return m_wblnode->o->m_ohtime;
}
pwr_tTime wb_orepwbl::rbTime() const
{
return m_wblnode->o->m_rbtime;
}
pwr_tTime wb_orepwbl::dbTime() const
{
return m_wblnode->o->m_dbtime;
}
......
/**
* Proview $Id: wb_orepwbl.h,v 1.10 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepwbl.h,v 1.11 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -54,6 +54,8 @@ public:
virtual const char * name() const;
virtual wb_name longName();
virtual pwr_tTime ohTime() const;
virtual pwr_tTime rbTime() const;
virtual pwr_tTime dbTime() const;
virtual pwr_mClassDef flags() const;
virtual bool isOffspringOf(const wb_orep *o) const;
......@@ -78,6 +80,7 @@ public:
wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;}
virtual ldh_eVolRep vtype() const { return ldh_eVolRep_Wbl;}
bool docBlock( char **block, int *size) const;
};
......
/**
* Proview $Id: wb_print_wbl.cpp,v 1.11 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_print_wbl.cpp,v 1.12 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -38,6 +38,7 @@
wb_print_wbl::wb_print_wbl(ostream& os, int levelIndentation) :
m_errCnt(0),
m_idxFlag(true),
m_timeFlag(true),
m_level(0),
m_levelInd(levelIndentation),
m_keepName(false),
......@@ -106,6 +107,7 @@ void wb_print_wbl::printBody(wb_volume& v,
wb_attribute attr;
wb_attribute tattr;
const char* bname;
char timestr[40] = " ";
wb_bdef bdef = cdef.bdef(bix);
......@@ -122,8 +124,25 @@ void wb_print_wbl::printBody(wb_volume& v,
return;
}
if ( m_timeFlag) {
// Get body time
pwr_tTime btime;
switch ( bix) {
case pwr_eBix_rt:
btime = o.rbTime();
strcpy( timestr, " ");
time_AtoAscii( &btime, time_eFormat_DateAndTime, &timestr[1], sizeof(timestr)-1);
break;
case pwr_eBix_dev:
btime = o.dbTime();
strcpy( timestr, " ");
time_AtoAscii( &btime, time_eFormat_DateAndTime, &timestr[1], sizeof(timestr)-1);
break;
default: ;
}
}
indent(1) << "Body " << bdef.name() << endl;
indent(1) << "Body " << bdef.name() << timestr << endl;
for (adef = bdef.adef(); adef; adef = adef.next()) {
attr = o.attribute(bname, adef.name());
tattr = templ.attribute(bname, adef.name());
......@@ -425,6 +444,14 @@ void wb_print_wbl::printObject(wb_volume& v, wb_object& o, bool recursive)
}
m_os << " " << idx;
}
if ( m_timeFlag) {
// Get oh time
char timestr[40];
pwr_tTime ohtime = o.ohTime();
time_AtoAscii( &ohtime, time_eFormat_DateAndTime, timestr, sizeof(timestr));
m_os << " " << timestr;
}
m_os << endl;
wb_object co = v.object(cdh_ClassIdToObjid(cdef.cid()));
......
/**
* Proview $Id: wb_print_wbl.h,v 1.6 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_print_wbl.h,v 1.7 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -43,6 +43,7 @@ class wb_print_wbl
protected:
int m_errCnt;
bool m_idxFlag;
bool m_timeFlag;
int m_level;
int m_levelInd;
char m_indBuf[256];
......
/**
* Proview $Id: wb_vrep.h,v 1.22 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_vrep.h,v 1.23 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -81,6 +81,8 @@ public:
virtual const char * objectName(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual pwr_tTime rbTime(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual pwr_tTime dbTime(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual pwr_mClassDef flags(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual bool isOffspringOf(pwr_tStatus *sts, const wb_orep *child, const wb_orep *parent) = 0;
......
/**
* Proview $Id: wb_vrepdb.cpp,v 1.38 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_vrepdb.cpp,v 1.39 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -818,6 +818,36 @@ pwr_tTime wb_vrepdb::ohTime(pwr_tStatus *sts, const wb_orep *orp)
}
}
pwr_tTime wb_vrepdb::rbTime(pwr_tStatus *sts, const wb_orep *orp)
{
*sts = LDH__SUCCESS;
try {
return m_ohead.get(m_db->m_txn, orp->oid()).rbTime();
}
catch (DbException &e) {
*sts = LDH__NOSUCHOBJ;
pwr_tTime t = {0, 0};
printf("vrepdb: %s\n", e.what());
return t;
}
}
pwr_tTime wb_vrepdb::dbTime(pwr_tStatus *sts, const wb_orep *orp)
{
*sts = LDH__SUCCESS;
try {
return m_ohead.get(m_db->m_txn, orp->oid()).dbTime();
}
catch (DbException &e) {
*sts = LDH__NOSUCHOBJ;
pwr_tTime t = {0, 0};
printf("vrepdb: %s\n", e.what());
return t;
}
}
pwr_mClassDef wb_vrepdb::flags(pwr_tStatus *sts, const wb_orep *orp)
{
*sts = LDH__SUCCESS;
......
/**
* Proview $Id: wb_vrepdb.h,v 1.26 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_vrepdb.h,v 1.27 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -98,6 +98,8 @@ public:
virtual wb_vrep *next();
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tTime rbTime(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tTime dbTime(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_mClassDef flags(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tOid oid(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tVid vid(pwr_tStatus *sts, const wb_orep *o);
......
/**
* Proview $Id: wb_vrepdbs.cpp,v 1.43 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_vrepdbs.cpp,v 1.44 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -170,6 +170,16 @@ pwr_tTime wb_vrepdbs::ohTime(pwr_tStatus *sts, const wb_orep *o)
return o->ohTime();
}
pwr_tTime wb_vrepdbs::rbTime(pwr_tStatus *sts, const wb_orep *o)
{
return o->rbTime();
}
pwr_tTime wb_vrepdbs::dbTime(pwr_tStatus *sts, const wb_orep *o)
{
return o->dbTime();
}
pwr_mClassDef wb_vrepdbs::flags(pwr_tStatus *sts, const wb_orep *o)
{
return o->flags();
......
/**
* Proview $Id: wb_vrepdbs.h,v 1.31 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_vrepdbs.h,v 1.32 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -75,6 +75,8 @@ public:
virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tTime rbTime(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tTime dbTime(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_mClassDef flags(pwr_tStatus *sts, const wb_orep *o);
virtual bool isOffspringOf(pwr_tStatus *sts, const wb_orep *child, const wb_orep *parent) { return false;}
......
/**
* Proview $Id: wb_vrepext.h,v 1.2 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_vrepext.h,v 1.3 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -171,7 +171,9 @@ public:
virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o) { return wb_name();}
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) { pwr_tTime t = {0, 0}; return t;}
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) { return o->ohTime();}
virtual pwr_tTime rbTime(pwr_tStatus *sts, const wb_orep *o) { return o->rbTime();}
virtual pwr_tTime dbTime(pwr_tStatus *sts, const wb_orep *o) { return o->dbTime();}
virtual pwr_mClassDef flags(pwr_tStatus *sts, const wb_orep *o) { pwr_mClassDef f; f.m = 0; return f;}
virtual bool isOffspringOf(pwr_tStatus *sts, const wb_orep *child, const wb_orep *parent) { return false;}
......
/**
* Proview $Id: wb_vrepmem.cpp,v 1.16 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_vrepmem.cpp,v 1.17 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -514,7 +514,11 @@ void wb_vrepmem::objectName(const wb_orep *o, char *str)
bool wb_vrepmem::writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, size_t offset, size_t size, void *p)
{
pwr_tTime time;
*sts = LDH__SUCCESS;
clock_gettime(CLOCK_REALTIME, &time);
mem_object *n = ((wb_orepmem *) o)->memobject();
......@@ -525,6 +529,7 @@ bool wb_vrepmem::writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, size
return false;
}
memcpy( (char *)n->rbody + offset, p, MIN(n->rbody_size - offset, size));
n->m_rbtime = time;
return true;
case pwr_eBix_dev:
if ( n->dbody_size == 0) {
......@@ -532,6 +537,7 @@ bool wb_vrepmem::writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, size
return false;
}
memcpy( (char *)n->dbody + offset, p, MIN(n->dbody_size - offset, size));
n->m_dbtime = time;
return true;
default:
*sts = LDH__NOSUCHBODY;
......@@ -574,7 +580,10 @@ void *wb_vrepmem::readAttribute(pwr_tStatus *sts, const wb_orep *o, pwr_eBix bix
bool wb_vrepmem::writeBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p)
{
pwr_tTime time;
*sts = LDH__SUCCESS;
clock_gettime(CLOCK_REALTIME, &time);
mem_object *n = ((wb_orepmem *) o)->memobject();
......@@ -586,6 +595,7 @@ bool wb_vrepmem::writeBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p)
}
memcpy( n->rbody, p, n->rbody_size);
n->m_rbtime = time;
return true;
case pwr_eBix_dev:
if ( n->dbody_size == 0) {
......@@ -593,6 +603,7 @@ bool wb_vrepmem::writeBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p)
return false;
}
memcpy( n->dbody, p, n->dbody_size);
n->m_dbtime = time;
return true;
default:
*sts = LDH__NOSUCHBODY;
......@@ -681,6 +692,9 @@ wb_orep *wb_vrepmem::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination
ldh_eDest code = d.code();
char name_str[32];
pwr_tOix oix;
pwr_tTime time;
clock_gettime(CLOCK_REALTIME, &time);
if ( d.oid().oix == 0) {
dest = root_object;
......@@ -717,20 +731,24 @@ wb_orep *wb_vrepmem::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination
strcpy( name_str, name.object());
}
mem_object *memo = new mem_object();
strcpy( memo->m_name, name_str);
memo->m_oid.oix = oix;
memo->m_oid.vid = m_vid;
memo->m_cid = cdef.cid();
memo->m_flags = cdef.flags();
memo->m_ohtime = time;
memo->rbody_size = cdef.size( pwr_eBix_rt);
if ( memo->rbody_size) {
memo->m_rbtime = time;
memo->rbody = malloc( memo->rbody_size);
cdef.templateBody( sts, pwr_eBix_rt, memo->rbody, memo->m_oid);
if ( EVEN(*sts)) return 0;
}
memo->dbody_size = cdef.size( pwr_eBix_dev);
if ( memo->dbody_size) {
memo->m_dbtime = time;
memo->dbody = malloc( memo->dbody_size);
cdef.templateBody( sts, pwr_eBix_dev, memo->dbody, memo->m_oid);
if ( EVEN(*sts)) return 0;
......@@ -830,6 +848,9 @@ wb_orep *wb_vrepmem::copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destin
mem_object *dest;
ldh_eDest code = d.code();
char name_str[32];
pwr_tTime time;
clock_gettime(CLOCK_REALTIME, &time);
if ( cdh_ObjidIsNull( d.oid())) {
dest = root_object;
......@@ -867,12 +888,14 @@ wb_orep *wb_vrepmem::copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destin
memo->m_oid.oix = oix;
memo->m_oid.vid = m_vid;
memo->m_cid = orep->cid();
memo->m_ohtime = time;
wb_attribute rbody;
rbody = wb_attribute( LDH__SUCCESS, (wb_orep *)orep, "RtBody");
if ( !rbody)
rbody = wb_attribute( LDH__SUCCESS, (wb_orep *)orep, "SysBody");
if ( rbody) {
memo->m_rbtime = time;
memo->rbody_size = rbody.size();
memo->rbody = malloc( memo->rbody_size);
rbody.value( memo->rbody);
......@@ -881,6 +904,7 @@ wb_orep *wb_vrepmem::copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destin
wb_attribute dbody;
dbody = wb_attribute( LDH__SUCCESS, (wb_orep *)orep, "DevBody");
if ( dbody) {
memo->m_dbtime = time;
memo->dbody_size = dbody.size();
memo->dbody = malloc( memo->dbody_size);
dbody.value( memo->dbody);
......@@ -953,6 +977,9 @@ bool wb_vrepmem::moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination &d)
{
mem_object *dest;
ldh_eDest code = d.code();
pwr_tTime time;
clock_gettime(CLOCK_REALTIME, &time);
if ( cdh_ObjidIsEqual( d.oid(), orep->oid()))
return false;
......@@ -1038,6 +1065,8 @@ bool wb_vrepmem::moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination &d)
return false;
}
memo->m_ohtime = time;
return true;
}
......@@ -1105,6 +1134,10 @@ void wb_vrepmem::deleteChildren( mem_object *memo)
bool wb_vrepmem::renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name &name)
{
pwr_tTime time;
clock_gettime(CLOCK_REALTIME, &time);
mem_object *memo = ((wb_orepmem *)orep)->memobject();
if ( !memo) return false;
......@@ -1128,6 +1161,9 @@ bool wb_vrepmem::renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name &name)
strcpy( memo->m_name, old_name);
return LDH__NAMALREXI;
}
memo->m_ohtime = time;
*sts = LDH__SUCCESS;
return true;
}
......@@ -1399,6 +1435,9 @@ bool wb_vrepmem::importPasteObject(pwr_tOid destination, ldh_eDest destcode,
pwr_tOid *roid)
{
pwr_tStatus sts;
pwr_tTime time;
clock_gettime(CLOCK_REALTIME, &time);
mem_object *memo = new mem_object();
strcpy( memo->m_name, name);
......@@ -1475,13 +1514,16 @@ bool wb_vrepmem::importPasteObject(pwr_tOid destination, ldh_eDest destcode,
memo->m_oid.vid = m_vid;
memo->m_cid = cid;
memo->m_flags = flags;
memo->m_ohtime = time;
memo->rbody_size = rbSize;
if ( memo->rbody_size) {
memo->m_rbtime = time;
memo->rbody = malloc( memo->rbody_size);
memcpy( memo->rbody, rbody, memo->rbody_size);
}
memo->dbody_size = dbSize;
if ( memo->dbody_size) {
memo->m_dbtime = time;
memo->dbody = malloc( memo->dbody_size);
memcpy( memo->dbody, dbody, memo->dbody_size);
}
......@@ -1716,7 +1758,7 @@ bool wb_vrepmem::importBuildObject( mem_object *memo)
bool wb_vrepmem::importHead(pwr_tOid oid, pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, pwr_tOid aoid, pwr_tOid foid, pwr_tOid loid,
const char *name, const char *normname, pwr_mClassDef flags,
pwr_tTime time, pwr_tTime rbTime, pwr_tTime dbTime,
pwr_tTime ohTime, pwr_tTime rbTime, pwr_tTime dbTime,
size_t rbSize, size_t dbSize)
{
......@@ -1732,7 +1774,9 @@ bool wb_vrepmem::importHead(pwr_tOid oid, pwr_tCid cid, pwr_tOid poid,
memo->bwsoid = boid;
memo->fwsoid = aoid;
memo->fchoid = foid;
memo->time = time;
memo->m_ohtime = ohTime;
memo->m_rbtime = rbTime;
memo->m_dbtime = dbTime;
if (oid.oix == pwr_cNOix) {
// this is the volume object
......
/**
* Proview $Id: wb_vrepmem.h,v 1.15 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_vrepmem.h,v 1.16 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -45,6 +45,12 @@ class mem_object
m_flags.m = 0;
m_oid.oix = 0;
m_oid.vid = 0;
m_ohtime.tv_sec = 0;
m_ohtime.tv_nsec = 0;
m_rbtime.tv_sec = 0;
m_rbtime.tv_nsec = 0;
m_dbtime.tv_sec = 0;
m_dbtime.tv_nsec = 0;
}
~mem_object() {
if ( rbody_size) free( rbody);
......@@ -180,7 +186,9 @@ class mem_object
pwr_tOid fwsoid;
pwr_tOid fchoid;
int is_built;
pwr_tTime time;
pwr_tTime m_ohtime;
pwr_tTime m_rbtime;
pwr_tTime m_dbtime;
};
class wb_orepmem;
......@@ -256,7 +264,9 @@ public:
virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o) { return wb_name();}
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) { pwr_tTime t = {0, 0}; return t;}
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) { return o->ohTime();}
virtual pwr_tTime rbTime(pwr_tStatus *sts, const wb_orep *o) { return o->rbTime();}
virtual pwr_tTime dbTime(pwr_tStatus *sts, const wb_orep *o) { return o->dbTime();}
virtual pwr_mClassDef flags(pwr_tStatus *sts, const wb_orep *o) { pwr_mClassDef f; f.m = 0; return f;}
virtual bool isOffspringOf(pwr_tStatus *sts, const wb_orep *child, const wb_orep *parent) { return false;}
......
/**
* Proview $Id: wb_vrepref.h,v 1.3 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_vrepref.h,v 1.4 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -88,7 +88,9 @@ public:
virtual pwr_tOid aoid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOid;}
virtual const char * objectName(pwr_tStatus *sts, const wb_orep *o) { return "";}
virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o) { return wb_name();}
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) { pwr_tTime t = {0, 0}; return t;}
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) { return o->ohTime();}
virtual pwr_tTime rbTime(pwr_tStatus *sts, const wb_orep *o) { return o->rbTime();}
virtual pwr_tTime dbTime(pwr_tStatus *sts, const wb_orep *o) { return o->dbTime();}
virtual pwr_mClassDef flags(pwr_tStatus *sts, const wb_orep *o) { pwr_mClassDef f; f.m = 0; return f;}
virtual void objectName(const wb_orep *o, char *str);
virtual bool isOffspringOf(pwr_tStatus *sts, const wb_orep *child, const wb_orep *parent) { return false;}
......
/**
* Proview $Id: wb_vrepwbl.h,v 1.33 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_vrepwbl.h,v 1.34 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -139,7 +139,9 @@ public:
virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o) { return wb_name();}
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) { pwr_tTime t = {0, 0}; return t;}
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) { return o->ohTime();}
virtual pwr_tTime rbTime(pwr_tStatus *sts, const wb_orep *o) { return o->rbTime();}
virtual pwr_tTime dbTime(pwr_tStatus *sts, const wb_orep *o) { return o->dbTime();}
virtual pwr_mClassDef flags(pwr_tStatus *sts, const wb_orep *o) { pwr_mClassDef f; f.m = 0; return f;}
......
......@@ -251,7 +251,7 @@ void wb_wbllexer::mWS(bool _createToken) {
{
match(static_cast<unsigned char>('\n'));
if ( inputState->guessing==0 ) {
#line 49 "wb_wbllexer.g"
#line 50 "wb_wbllexer.g"
newline();
#line 257 "wb_wbllexer.cpp"
}
......@@ -272,7 +272,7 @@ void wb_wbllexer::mWS(bool _createToken) {
_loop5:;
}
if ( inputState->guessing==0 ) {
#line 51 "wb_wbllexer.g"
#line 52 "wb_wbllexer.g"
_ttype = antlr::Token::SKIP;
#line 278 "wb_wbllexer.cpp"
}
......@@ -334,7 +334,7 @@ void wb_wbllexer::mCOMMENT(bool _createToken) {
}
if ( inputState->guessing==0 ) {
#line 57 "wb_wbllexer.g"
#line 58 "wb_wbllexer.g"
_ttype = antlr::Token::SKIP; newline();
#line 340 "wb_wbllexer.cpp"
}
......@@ -361,7 +361,7 @@ void wb_wbllexer::mDOCBLOCK(bool _createToken) {
match(static_cast<unsigned char>('\r'));
match(static_cast<unsigned char>('\n'));
if ( inputState->guessing==0 ) {
#line 74 "wb_wbllexer.g"
#line 75 "wb_wbllexer.g"
newline();
#line 367 "wb_wbllexer.cpp"
}
......@@ -369,7 +369,7 @@ void wb_wbllexer::mDOCBLOCK(bool _createToken) {
else if ((LA(1)==static_cast<unsigned char>('\r')) && ((LA(2) >= static_cast<unsigned char>('\3') && LA(2) <= static_cast<unsigned char>('\377')))) {
match(static_cast<unsigned char>('\r'));
if ( inputState->guessing==0 ) {
#line 75 "wb_wbllexer.g"
#line 76 "wb_wbllexer.g"
newline();
#line 375 "wb_wbllexer.cpp"
}
......@@ -377,7 +377,7 @@ void wb_wbllexer::mDOCBLOCK(bool _createToken) {
else if ((LA(1)==static_cast<unsigned char>('\n'))) {
match(static_cast<unsigned char>('\n'));
if ( inputState->guessing==0 ) {
#line 76 "wb_wbllexer.g"
#line 77 "wb_wbllexer.g"
newline();
#line 383 "wb_wbllexer.cpp"
}
......@@ -580,7 +580,7 @@ void wb_wbllexer::mVALUE(bool _createToken) {
oname:;
}
if ( inputState->guessing==0 ) {
#line 100 "wb_wbllexer.g"
#line 101 "wb_wbllexer.g"
_ttype = OBJECT;
#line 586 "wb_wbllexer.cpp"
}
......@@ -609,7 +609,7 @@ void wb_wbllexer::mVALUE(bool _createToken) {
mWS(false);
text.erase(_saveIndex);
if ( inputState->guessing==0 ) {
#line 102 "wb_wbllexer.g"
#line 103 "wb_wbllexer.g"
_ttype = ENDOBJECT;
#line 615 "wb_wbllexer.cpp"
}
......@@ -757,7 +757,7 @@ void wb_wbllexer::mVALUE(bool _createToken) {
soname:;
}
if ( inputState->guessing==0 ) {
#line 104 "wb_wbllexer.g"
#line 105 "wb_wbllexer.g"
_ttype = SOBJECT;
#line 763 "wb_wbllexer.cpp"
}
......@@ -786,7 +786,7 @@ void wb_wbllexer::mVALUE(bool _createToken) {
mWS(false);
text.erase(_saveIndex);
if ( inputState->guessing==0 ) {
#line 106 "wb_wbllexer.g"
#line 107 "wb_wbllexer.g"
_ttype = ENDSOBJECT;
#line 792 "wb_wbllexer.cpp"
}
......@@ -924,7 +924,7 @@ void wb_wbllexer::mVALUE(bool _createToken) {
doname:;
}
if ( inputState->guessing==0 ) {
#line 108 "wb_wbllexer.g"
#line 109 "wb_wbllexer.g"
_ttype = DOBJECT;
#line 930 "wb_wbllexer.cpp"
}
......@@ -953,7 +953,7 @@ void wb_wbllexer::mVALUE(bool _createToken) {
mWS(false);
text.erase(_saveIndex);
if ( inputState->guessing==0 ) {
#line 110 "wb_wbllexer.g"
#line 111 "wb_wbllexer.g"
_ttype = ENDDOBJECT;
#line 959 "wb_wbllexer.cpp"
}
......@@ -1099,7 +1099,7 @@ void wb_wbllexer::mVALUE(bool _createToken) {
}
if ( inputState->guessing==0 ) {
#line 112 "wb_wbllexer.g"
#line 113 "wb_wbllexer.g"
_ttype = VOLUME;
#line 1105 "wb_wbllexer.cpp"
}
......@@ -1128,7 +1128,7 @@ void wb_wbllexer::mVALUE(bool _createToken) {
mWS(false);
text.erase(_saveIndex);
if ( inputState->guessing==0 ) {
#line 114 "wb_wbllexer.g"
#line 115 "wb_wbllexer.g"
_ttype = ENDVOLUME;
#line 1134 "wb_wbllexer.cpp"
}
......@@ -1266,7 +1266,7 @@ void wb_wbllexer::mVALUE(bool _createToken) {
buname:;
}
if ( inputState->guessing==0 ) {
#line 116 "wb_wbllexer.g"
#line 117 "wb_wbllexer.g"
_ttype = BUFFER;
#line 1272 "wb_wbllexer.cpp"
}
......@@ -1295,7 +1295,7 @@ void wb_wbllexer::mVALUE(bool _createToken) {
mWS(false);
text.erase(_saveIndex);
if ( inputState->guessing==0 ) {
#line 118 "wb_wbllexer.g"
#line 119 "wb_wbllexer.g"
_ttype = ENDBUFFER;
#line 1301 "wb_wbllexer.cpp"
}
......@@ -1433,7 +1433,7 @@ void wb_wbllexer::mVALUE(bool _createToken) {
boname:;
}
if ( inputState->guessing==0 ) {
#line 120 "wb_wbllexer.g"
#line 121 "wb_wbllexer.g"
_ttype = BODY;
#line 1439 "wb_wbllexer.cpp"
}
......@@ -1462,7 +1462,7 @@ void wb_wbllexer::mVALUE(bool _createToken) {
mWS(false);
text.erase(_saveIndex);
if ( inputState->guessing==0 ) {
#line 122 "wb_wbllexer.g"
#line 123 "wb_wbllexer.g"
_ttype = ENDBODY;
#line 1468 "wb_wbllexer.cpp"
}
......@@ -1739,7 +1739,7 @@ void wb_wbllexer::mVALUE(bool _createToken) {
_loop63:;
}
if ( inputState->guessing==0 ) {
#line 124 "wb_wbllexer.g"
#line 125 "wb_wbllexer.g"
_ttype = ATTRIBUTE;
#line 1745 "wb_wbllexer.cpp"
}
......@@ -1782,16 +1782,512 @@ void wb_wbllexer::mVALUE(bool _createToken) {
}
if ( inputState->guessing==0 ) {
#line 126 "wb_wbllexer.g"
#line 127 "wb_wbllexer.g"
_ttype = OID;
#line 1788 "wb_wbllexer.cpp"
}
}
else {
bool synPredMatched68 = false;
bool synPredMatched73 = false;
if ((((LA(1) >= static_cast<unsigned char>('0') && LA(1) <= static_cast<unsigned char>('9'))) && ((LA(2) >= static_cast<unsigned char>('0') && LA(2) <= static_cast<unsigned char>('9'))))) {
int _m73 = mark();
synPredMatched73 = true;
inputState->guessing++;
try {
{
{
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
{
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
match(static_cast<unsigned char>('-'));
{
switch ( LA(1)) {
case static_cast<unsigned char>('a'):
case static_cast<unsigned char>('b'):
case static_cast<unsigned char>('c'):
case static_cast<unsigned char>('d'):
case static_cast<unsigned char>('e'):
case static_cast<unsigned char>('f'):
case static_cast<unsigned char>('g'):
case static_cast<unsigned char>('h'):
case static_cast<unsigned char>('i'):
case static_cast<unsigned char>('j'):
case static_cast<unsigned char>('k'):
case static_cast<unsigned char>('l'):
case static_cast<unsigned char>('m'):
case static_cast<unsigned char>('n'):
case static_cast<unsigned char>('o'):
case static_cast<unsigned char>('p'):
case static_cast<unsigned char>('q'):
case static_cast<unsigned char>('r'):
case static_cast<unsigned char>('s'):
case static_cast<unsigned char>('t'):
case static_cast<unsigned char>('u'):
case static_cast<unsigned char>('v'):
case static_cast<unsigned char>('w'):
case static_cast<unsigned char>('x'):
case static_cast<unsigned char>('y'):
case static_cast<unsigned char>('z'):
{
matchRange(static_cast<unsigned char>('a'),static_cast<unsigned char>('z'));
break;
}
case static_cast<unsigned char>('A'):
case static_cast<unsigned char>('B'):
case static_cast<unsigned char>('C'):
case static_cast<unsigned char>('D'):
case static_cast<unsigned char>('E'):
case static_cast<unsigned char>('F'):
case static_cast<unsigned char>('G'):
case static_cast<unsigned char>('H'):
case static_cast<unsigned char>('I'):
case static_cast<unsigned char>('J'):
case static_cast<unsigned char>('K'):
case static_cast<unsigned char>('L'):
case static_cast<unsigned char>('M'):
case static_cast<unsigned char>('N'):
case static_cast<unsigned char>('O'):
case static_cast<unsigned char>('P'):
case static_cast<unsigned char>('Q'):
case static_cast<unsigned char>('R'):
case static_cast<unsigned char>('S'):
case static_cast<unsigned char>('T'):
case static_cast<unsigned char>('U'):
case static_cast<unsigned char>('V'):
case static_cast<unsigned char>('W'):
case static_cast<unsigned char>('X'):
case static_cast<unsigned char>('Y'):
case static_cast<unsigned char>('Z'):
{
matchRange(static_cast<unsigned char>('A'),static_cast<unsigned char>('Z'));
break;
}
default:
{
throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine());
}
}
}
{
switch ( LA(1)) {
case static_cast<unsigned char>('a'):
case static_cast<unsigned char>('b'):
case static_cast<unsigned char>('c'):
case static_cast<unsigned char>('d'):
case static_cast<unsigned char>('e'):
case static_cast<unsigned char>('f'):
case static_cast<unsigned char>('g'):
case static_cast<unsigned char>('h'):
case static_cast<unsigned char>('i'):
case static_cast<unsigned char>('j'):
case static_cast<unsigned char>('k'):
case static_cast<unsigned char>('l'):
case static_cast<unsigned char>('m'):
case static_cast<unsigned char>('n'):
case static_cast<unsigned char>('o'):
case static_cast<unsigned char>('p'):
case static_cast<unsigned char>('q'):
case static_cast<unsigned char>('r'):
case static_cast<unsigned char>('s'):
case static_cast<unsigned char>('t'):
case static_cast<unsigned char>('u'):
case static_cast<unsigned char>('v'):
case static_cast<unsigned char>('w'):
case static_cast<unsigned char>('x'):
case static_cast<unsigned char>('y'):
case static_cast<unsigned char>('z'):
{
matchRange(static_cast<unsigned char>('a'),static_cast<unsigned char>('z'));
break;
}
case static_cast<unsigned char>('A'):
case static_cast<unsigned char>('B'):
case static_cast<unsigned char>('C'):
case static_cast<unsigned char>('D'):
case static_cast<unsigned char>('E'):
case static_cast<unsigned char>('F'):
case static_cast<unsigned char>('G'):
case static_cast<unsigned char>('H'):
case static_cast<unsigned char>('I'):
case static_cast<unsigned char>('J'):
case static_cast<unsigned char>('K'):
case static_cast<unsigned char>('L'):
case static_cast<unsigned char>('M'):
case static_cast<unsigned char>('N'):
case static_cast<unsigned char>('O'):
case static_cast<unsigned char>('P'):
case static_cast<unsigned char>('Q'):
case static_cast<unsigned char>('R'):
case static_cast<unsigned char>('S'):
case static_cast<unsigned char>('T'):
case static_cast<unsigned char>('U'):
case static_cast<unsigned char>('V'):
case static_cast<unsigned char>('W'):
case static_cast<unsigned char>('X'):
case static_cast<unsigned char>('Y'):
case static_cast<unsigned char>('Z'):
{
matchRange(static_cast<unsigned char>('A'),static_cast<unsigned char>('Z'));
break;
}
default:
{
throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine());
}
}
}
{
switch ( LA(1)) {
case static_cast<unsigned char>('a'):
case static_cast<unsigned char>('b'):
case static_cast<unsigned char>('c'):
case static_cast<unsigned char>('d'):
case static_cast<unsigned char>('e'):
case static_cast<unsigned char>('f'):
case static_cast<unsigned char>('g'):
case static_cast<unsigned char>('h'):
case static_cast<unsigned char>('i'):
case static_cast<unsigned char>('j'):
case static_cast<unsigned char>('k'):
case static_cast<unsigned char>('l'):
case static_cast<unsigned char>('m'):
case static_cast<unsigned char>('n'):
case static_cast<unsigned char>('o'):
case static_cast<unsigned char>('p'):
case static_cast<unsigned char>('q'):
case static_cast<unsigned char>('r'):
case static_cast<unsigned char>('s'):
case static_cast<unsigned char>('t'):
case static_cast<unsigned char>('u'):
case static_cast<unsigned char>('v'):
case static_cast<unsigned char>('w'):
case static_cast<unsigned char>('x'):
case static_cast<unsigned char>('y'):
case static_cast<unsigned char>('z'):
{
matchRange(static_cast<unsigned char>('a'),static_cast<unsigned char>('z'));
break;
}
case static_cast<unsigned char>('A'):
case static_cast<unsigned char>('B'):
case static_cast<unsigned char>('C'):
case static_cast<unsigned char>('D'):
case static_cast<unsigned char>('E'):
case static_cast<unsigned char>('F'):
case static_cast<unsigned char>('G'):
case static_cast<unsigned char>('H'):
case static_cast<unsigned char>('I'):
case static_cast<unsigned char>('J'):
case static_cast<unsigned char>('K'):
case static_cast<unsigned char>('L'):
case static_cast<unsigned char>('M'):
case static_cast<unsigned char>('N'):
case static_cast<unsigned char>('O'):
case static_cast<unsigned char>('P'):
case static_cast<unsigned char>('Q'):
case static_cast<unsigned char>('R'):
case static_cast<unsigned char>('S'):
case static_cast<unsigned char>('T'):
case static_cast<unsigned char>('U'):
case static_cast<unsigned char>('V'):
case static_cast<unsigned char>('W'):
case static_cast<unsigned char>('X'):
case static_cast<unsigned char>('Y'):
case static_cast<unsigned char>('Z'):
{
matchRange(static_cast<unsigned char>('A'),static_cast<unsigned char>('Z'));
break;
}
default:
{
throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine());
}
}
}
match(static_cast<unsigned char>('-'));
}
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
synPredMatched73 = false;
}
rewind(_m73);
inputState->guessing--;
}
if ( synPredMatched73 ) {
{
{
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
{
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
match(static_cast<unsigned char>('-'));
{
switch ( LA(1)) {
case static_cast<unsigned char>('a'):
case static_cast<unsigned char>('b'):
case static_cast<unsigned char>('c'):
case static_cast<unsigned char>('d'):
case static_cast<unsigned char>('e'):
case static_cast<unsigned char>('f'):
case static_cast<unsigned char>('g'):
case static_cast<unsigned char>('h'):
case static_cast<unsigned char>('i'):
case static_cast<unsigned char>('j'):
case static_cast<unsigned char>('k'):
case static_cast<unsigned char>('l'):
case static_cast<unsigned char>('m'):
case static_cast<unsigned char>('n'):
case static_cast<unsigned char>('o'):
case static_cast<unsigned char>('p'):
case static_cast<unsigned char>('q'):
case static_cast<unsigned char>('r'):
case static_cast<unsigned char>('s'):
case static_cast<unsigned char>('t'):
case static_cast<unsigned char>('u'):
case static_cast<unsigned char>('v'):
case static_cast<unsigned char>('w'):
case static_cast<unsigned char>('x'):
case static_cast<unsigned char>('y'):
case static_cast<unsigned char>('z'):
{
matchRange(static_cast<unsigned char>('a'),static_cast<unsigned char>('z'));
break;
}
case static_cast<unsigned char>('A'):
case static_cast<unsigned char>('B'):
case static_cast<unsigned char>('C'):
case static_cast<unsigned char>('D'):
case static_cast<unsigned char>('E'):
case static_cast<unsigned char>('F'):
case static_cast<unsigned char>('G'):
case static_cast<unsigned char>('H'):
case static_cast<unsigned char>('I'):
case static_cast<unsigned char>('J'):
case static_cast<unsigned char>('K'):
case static_cast<unsigned char>('L'):
case static_cast<unsigned char>('M'):
case static_cast<unsigned char>('N'):
case static_cast<unsigned char>('O'):
case static_cast<unsigned char>('P'):
case static_cast<unsigned char>('Q'):
case static_cast<unsigned char>('R'):
case static_cast<unsigned char>('S'):
case static_cast<unsigned char>('T'):
case static_cast<unsigned char>('U'):
case static_cast<unsigned char>('V'):
case static_cast<unsigned char>('W'):
case static_cast<unsigned char>('X'):
case static_cast<unsigned char>('Y'):
case static_cast<unsigned char>('Z'):
{
matchRange(static_cast<unsigned char>('A'),static_cast<unsigned char>('Z'));
break;
}
default:
{
throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine());
}
}
}
{
switch ( LA(1)) {
case static_cast<unsigned char>('a'):
case static_cast<unsigned char>('b'):
case static_cast<unsigned char>('c'):
case static_cast<unsigned char>('d'):
case static_cast<unsigned char>('e'):
case static_cast<unsigned char>('f'):
case static_cast<unsigned char>('g'):
case static_cast<unsigned char>('h'):
case static_cast<unsigned char>('i'):
case static_cast<unsigned char>('j'):
case static_cast<unsigned char>('k'):
case static_cast<unsigned char>('l'):
case static_cast<unsigned char>('m'):
case static_cast<unsigned char>('n'):
case static_cast<unsigned char>('o'):
case static_cast<unsigned char>('p'):
case static_cast<unsigned char>('q'):
case static_cast<unsigned char>('r'):
case static_cast<unsigned char>('s'):
case static_cast<unsigned char>('t'):
case static_cast<unsigned char>('u'):
case static_cast<unsigned char>('v'):
case static_cast<unsigned char>('w'):
case static_cast<unsigned char>('x'):
case static_cast<unsigned char>('y'):
case static_cast<unsigned char>('z'):
{
matchRange(static_cast<unsigned char>('a'),static_cast<unsigned char>('z'));
break;
}
case static_cast<unsigned char>('A'):
case static_cast<unsigned char>('B'):
case static_cast<unsigned char>('C'):
case static_cast<unsigned char>('D'):
case static_cast<unsigned char>('E'):
case static_cast<unsigned char>('F'):
case static_cast<unsigned char>('G'):
case static_cast<unsigned char>('H'):
case static_cast<unsigned char>('I'):
case static_cast<unsigned char>('J'):
case static_cast<unsigned char>('K'):
case static_cast<unsigned char>('L'):
case static_cast<unsigned char>('M'):
case static_cast<unsigned char>('N'):
case static_cast<unsigned char>('O'):
case static_cast<unsigned char>('P'):
case static_cast<unsigned char>('Q'):
case static_cast<unsigned char>('R'):
case static_cast<unsigned char>('S'):
case static_cast<unsigned char>('T'):
case static_cast<unsigned char>('U'):
case static_cast<unsigned char>('V'):
case static_cast<unsigned char>('W'):
case static_cast<unsigned char>('X'):
case static_cast<unsigned char>('Y'):
case static_cast<unsigned char>('Z'):
{
matchRange(static_cast<unsigned char>('A'),static_cast<unsigned char>('Z'));
break;
}
default:
{
throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine());
}
}
}
{
switch ( LA(1)) {
case static_cast<unsigned char>('a'):
case static_cast<unsigned char>('b'):
case static_cast<unsigned char>('c'):
case static_cast<unsigned char>('d'):
case static_cast<unsigned char>('e'):
case static_cast<unsigned char>('f'):
case static_cast<unsigned char>('g'):
case static_cast<unsigned char>('h'):
case static_cast<unsigned char>('i'):
case static_cast<unsigned char>('j'):
case static_cast<unsigned char>('k'):
case static_cast<unsigned char>('l'):
case static_cast<unsigned char>('m'):
case static_cast<unsigned char>('n'):
case static_cast<unsigned char>('o'):
case static_cast<unsigned char>('p'):
case static_cast<unsigned char>('q'):
case static_cast<unsigned char>('r'):
case static_cast<unsigned char>('s'):
case static_cast<unsigned char>('t'):
case static_cast<unsigned char>('u'):
case static_cast<unsigned char>('v'):
case static_cast<unsigned char>('w'):
case static_cast<unsigned char>('x'):
case static_cast<unsigned char>('y'):
case static_cast<unsigned char>('z'):
{
matchRange(static_cast<unsigned char>('a'),static_cast<unsigned char>('z'));
break;
}
case static_cast<unsigned char>('A'):
case static_cast<unsigned char>('B'):
case static_cast<unsigned char>('C'):
case static_cast<unsigned char>('D'):
case static_cast<unsigned char>('E'):
case static_cast<unsigned char>('F'):
case static_cast<unsigned char>('G'):
case static_cast<unsigned char>('H'):
case static_cast<unsigned char>('I'):
case static_cast<unsigned char>('J'):
case static_cast<unsigned char>('K'):
case static_cast<unsigned char>('L'):
case static_cast<unsigned char>('M'):
case static_cast<unsigned char>('N'):
case static_cast<unsigned char>('O'):
case static_cast<unsigned char>('P'):
case static_cast<unsigned char>('Q'):
case static_cast<unsigned char>('R'):
case static_cast<unsigned char>('S'):
case static_cast<unsigned char>('T'):
case static_cast<unsigned char>('U'):
case static_cast<unsigned char>('V'):
case static_cast<unsigned char>('W'):
case static_cast<unsigned char>('X'):
case static_cast<unsigned char>('Y'):
case static_cast<unsigned char>('Z'):
{
matchRange(static_cast<unsigned char>('A'),static_cast<unsigned char>('Z'));
break;
}
default:
{
throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine());
}
}
}
match(static_cast<unsigned char>('-'));
{
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
{
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
{
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
{
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
match(static_cast<unsigned char>(' '));
{
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
{
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
match(static_cast<unsigned char>(':'));
{
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
{
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
match(static_cast<unsigned char>(':'));
{
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
{
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
{
if ((LA(1)==static_cast<unsigned char>('.'))) {
match(static_cast<unsigned char>('.'));
{
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
{
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
}
else {
}
}
}
if ( inputState->guessing==0 ) {
#line 129 "wb_wbllexer.g"
_ttype = ASC_TIME;
#line 2284 "wb_wbllexer.cpp"
}
}
else {
bool synPredMatched94 = false;
if ((((LA(1) >= static_cast<unsigned char>('0') && LA(1) <= static_cast<unsigned char>('9'))) && (_tokenSet_2.member(LA(2))))) {
int _m68 = mark();
synPredMatched68 = true;
int _m94 = mark();
synPredMatched94 = true;
inputState->guessing++;
try {
{
......@@ -1800,12 +2296,12 @@ void wb_wbllexer::mVALUE(bool _createToken) {
}
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
synPredMatched68 = false;
synPredMatched94 = false;
}
rewind(_m68);
rewind(_m94);
inputState->guessing--;
}
if ( synPredMatched68 ) {
if ( synPredMatched94 ) {
mDIGITS(false);
match(static_cast<unsigned char>('.'));
{
......@@ -1814,11 +2310,11 @@ void wb_wbllexer::mVALUE(bool _createToken) {
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
else {
goto _loop70;
goto _loop96;
}
}
_loop70:;
_loop96:;
}
{
if ((LA(1)==static_cast<unsigned char>('E')||LA(1)==static_cast<unsigned char>('e'))) {
......@@ -1872,18 +2368,18 @@ void wb_wbllexer::mVALUE(bool _createToken) {
}
}
{
int _cnt75=0;
int _cnt101=0;
for (;;) {
if (((LA(1) >= static_cast<unsigned char>('0') && LA(1) <= static_cast<unsigned char>('9')))) {
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
else {
if ( _cnt75>=1 ) { goto _loop75; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine());}
if ( _cnt101>=1 ) { goto _loop101; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine());}
}
_cnt75++;
_cnt101++;
}
_loop75:;
_loop101:;
}
}
else {
......@@ -1891,16 +2387,16 @@ void wb_wbllexer::mVALUE(bool _createToken) {
}
if ( inputState->guessing==0 ) {
#line 128 "wb_wbllexer.g"
#line 131 "wb_wbllexer.g"
_ttype = NUM_FLOAT;
#line 1897 "wb_wbllexer.cpp"
#line 2393 "wb_wbllexer.cpp"
}
}
else {
bool synPredMatched77 = false;
bool synPredMatched103 = false;
if (((LA(1)==static_cast<unsigned char>('-')) && ((LA(2) >= static_cast<unsigned char>('0') && LA(2) <= static_cast<unsigned char>('9'))))) {
int _m77 = mark();
synPredMatched77 = true;
int _m103 = mark();
synPredMatched103 = true;
inputState->guessing++;
try {
{
......@@ -1910,12 +2406,12 @@ void wb_wbllexer::mVALUE(bool _createToken) {
}
}
catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
synPredMatched77 = false;
synPredMatched103 = false;
}
rewind(_m77);
rewind(_m103);
inputState->guessing--;
}
if ( synPredMatched77 ) {
if ( synPredMatched103 ) {
match(static_cast<unsigned char>('-'));
mDIGITS(false);
match(static_cast<unsigned char>('.'));
......@@ -1925,11 +2421,11 @@ void wb_wbllexer::mVALUE(bool _createToken) {
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
else {
goto _loop79;
goto _loop105;
}
}
_loop79:;
_loop105:;
}
{
if ((LA(1)==static_cast<unsigned char>('E')||LA(1)==static_cast<unsigned char>('e'))) {
......@@ -1983,18 +2479,18 @@ void wb_wbllexer::mVALUE(bool _createToken) {
}
}
{
int _cnt84=0;
int _cnt110=0;
for (;;) {
if (((LA(1) >= static_cast<unsigned char>('0') && LA(1) <= static_cast<unsigned char>('9')))) {
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
else {
if ( _cnt84>=1 ) { goto _loop84; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine());}
if ( _cnt110>=1 ) { goto _loop110; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine());}
}
_cnt84++;
_cnt110++;
}
_loop84:;
_loop110:;
}
}
else {
......@@ -2002,35 +2498,35 @@ void wb_wbllexer::mVALUE(bool _createToken) {
}
if ( inputState->guessing==0 ) {
#line 130 "wb_wbllexer.g"
#line 133 "wb_wbllexer.g"
_ttype = NUM_FLOAT;
#line 2008 "wb_wbllexer.cpp"
#line 2504 "wb_wbllexer.cpp"
}
}
else if ((LA(1)==static_cast<unsigned char>('-')) && ((LA(2) >= static_cast<unsigned char>('0') && LA(2) <= static_cast<unsigned char>('9')))) {
match(static_cast<unsigned char>('-'));
mDIGITS(false);
if ( inputState->guessing==0 ) {
#line 136 "wb_wbllexer.g"
#line 139 "wb_wbllexer.g"
_ttype = INT;
#line 2017 "wb_wbllexer.cpp"
#line 2513 "wb_wbllexer.cpp"
}
}
else if ((LA(1)==static_cast<unsigned char>('.'))) {
match(static_cast<unsigned char>('.'));
{
int _cnt86=0;
int _cnt112=0;
for (;;) {
if (((LA(1) >= static_cast<unsigned char>('0') && LA(1) <= static_cast<unsigned char>('9')))) {
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
else {
if ( _cnt86>=1 ) { goto _loop86; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine());}
if ( _cnt112>=1 ) { goto _loop112; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine());}
}
_cnt86++;
_cnt112++;
}
_loop86:;
_loop112:;
}
{
if ((LA(1)==static_cast<unsigned char>('E')||LA(1)==static_cast<unsigned char>('e'))) {
......@@ -2084,18 +2580,18 @@ void wb_wbllexer::mVALUE(bool _createToken) {
}
}
{
int _cnt91=0;
int _cnt117=0;
for (;;) {
if (((LA(1) >= static_cast<unsigned char>('0') && LA(1) <= static_cast<unsigned char>('9')))) {
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
else {
if ( _cnt91>=1 ) { goto _loop91; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine());}
if ( _cnt117>=1 ) { goto _loop117; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine());}
}
_cnt91++;
_cnt117++;
}
_loop91:;
_loop117:;
}
}
else {
......@@ -2103,17 +2599,17 @@ void wb_wbllexer::mVALUE(bool _createToken) {
}
if ( inputState->guessing==0 ) {
#line 132 "wb_wbllexer.g"
#line 135 "wb_wbllexer.g"
_ttype = NUM_FLOAT;
#line 2109 "wb_wbllexer.cpp"
#line 2605 "wb_wbllexer.cpp"
}
}
else if (((LA(1) >= static_cast<unsigned char>('0') && LA(1) <= static_cast<unsigned char>('9'))) && (true)) {
mDIGITS(false);
if ( inputState->guessing==0 ) {
#line 134 "wb_wbllexer.g"
#line 137 "wb_wbllexer.g"
_ttype = INT;
#line 2117 "wb_wbllexer.cpp"
#line 2613 "wb_wbllexer.cpp"
}
}
else if ((_tokenSet_3.member(LA(1))) && (true)) {
......@@ -2304,17 +2800,17 @@ void wb_wbllexer::mVALUE(bool _createToken) {
}
default:
{
goto _loop94;
goto _loop120;
}
}
}
_loop94:;
_loop120:;
}
}
else {
throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine());
}
}}}}}}}}}}}}}}}
}}}}}}}}}}}}}}}}
if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
_token = makeToken(_ttype);
_token->setText(text.substr(_begin, text.length()-_begin));
......@@ -2378,18 +2874,18 @@ void wb_wbllexer::mDIGITS(bool _createToken) {
int _saveIndex;
{
int _cnt102=0;
int _cnt128=0;
for (;;) {
if (((LA(1) >= static_cast<unsigned char>('0') && LA(1) <= static_cast<unsigned char>('9')))) {
matchRange(static_cast<unsigned char>('0'),static_cast<unsigned char>('9'));
}
else {
if ( _cnt102>=1 ) { goto _loop102; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine());}
if ( _cnt128>=1 ) { goto _loop128; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine());}
}
_cnt102++;
_cnt128++;
}
_loop102:;
_loop128:;
}
if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
_token = makeToken(_ttype);
......@@ -2511,9 +3007,9 @@ void wb_wbllexer::mSTRING_LITERAL(bool _createToken) {
{
match(static_cast<unsigned char>('\n'));
if ( inputState->guessing==0 ) {
#line 145 "wb_wbllexer.g"
#line 153 "wb_wbllexer.g"
newline();
#line 2517 "wb_wbllexer.cpp"
#line 3013 "wb_wbllexer.cpp"
}
break;
}
......@@ -2522,11 +3018,11 @@ void wb_wbllexer::mSTRING_LITERAL(bool _createToken) {
matchNot(static_cast<unsigned char>('"'));
}
else {
goto _loop99;
goto _loop125;
}
}
}
_loop99:;
_loop125:;
}
match(static_cast<unsigned char>('"'));
if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
......
......@@ -35,6 +35,7 @@ tokens {
INT;
OID;
DOCBLOCK;
ASC_TIME;
}
EQ : '='
......@@ -124,6 +125,8 @@ options {
{$setType(ATTRIBUTE);}
| (DIGITS '.' DIGITS '.' ) => DIGITS '.' DIGITS '.' DIGITS '.' DIGITS (':' DIGITS)?
{$setType(OID);}
| ( ('0'..'9') ('0'..'9') '-' ('a'..'z'|'A'..'Z')('a'..'z'|'A'..'Z')('a'..'z'|'A'..'Z') '-') => ( ('0'..'9') ('0'..'9') '-' ('a'..'z'|'A'..'Z')('a'..'z'|'A'..'Z')('a'..'z'|'A'..'Z') '-' ('0'..'9')('0'..'9')('0'..'9')('0'..'9') ' ' ('0'..'9')('0'..'9') ':' ('0'..'9')('0'..'9') ':' ('0'..'9')('0'..'9') ('.' ('0'..'9')('0'..'9'))?)
{$setType(ASC_TIME);}
| (DIGITS '.') => DIGITS '.' ('0'..'9')* (('e'|'E') ('+'|'-')? ('0'..'9')+)?
{$setType(NUM_FLOAT);}
| ('-' DIGITS '.') => '-' DIGITS '.' ('0'..'9')* (('e'|'E') ('+'|'-')? ('0'..'9')+)?
......@@ -137,6 +140,11 @@ options {
| ('a'..'z'|'A'..'Z'|'$'|'_'|SWEC) ('a'..'z'|'A'..'Z'|'0'..'9'|'$'|'_'|SWEC)*
;
/*
{$setType(ASC_TIME);}
| ('0'..'9')+ '-' (SWEC)+ '-' ('0'..'9')+ ' ' ('0'..'9')+ ':' ('0'..'9')+ ':' ('0'..'9')+ ('.' ('0'..'9')+)?
*/
CHAR_LITERAL
: '\'' (ESC|~'\'') '\''
;
......
/**
* Proview $Id: wb_wblnode.cpp,v 1.44 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_wblnode.cpp,v 1.45 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -369,6 +369,13 @@ int wb_wblnode::stringToOix( const char *buf, pwr_tOix *oix) const
return 1;
}
int wb_wblnode::stringToTime( const char *buf, pwr_tTime *time) const
{
pwr_tStatus sts;
sts = time_AsciiToA( (char *)buf, time);
return ODD(sts);
}
int wb_wblnode::lookup( int *type, const char *keyword, wbl_sSym *table)
{
int cond;
......@@ -980,7 +987,24 @@ void wb_wblnode::buildBody( ref_wblnode object)
m_vrep->error( "Bad body name", getFileName(), line_number);
}
for ( first_child = getFirstChild();
first_child = getFirstChild();
// First child might be body time
if ( first_child && first_child->getType() == tokens.ASC_TIME) {
string timestr = first_child->getText();
pwr_tTime bodytime;
if ( stringToTime( timestr.c_str(), &bodytime)) {
if ( bix == pwr_eBix_rt)
object->o->m_rbtime = bodytime;
else
object->o->m_dbtime = bodytime;
}
else
m_vrep->error( "Time syntax", getFileName(), line_number);
first_child = first_child->getNextSibling();
}
for ( ;
first_child;
first_child = first_child->getNextSibling())
first_child->buildAttr( object, bix);
......@@ -1501,6 +1525,9 @@ void wb_wblnode::registerNode( wb_vrepwbl *vol)
m_vrep->error( "Bad object name", getFileName(), line_number);
}
// Filetime is default for ohtime
o->m_ohtime = getFileTime();
// Get class
if ( first_child) {
string class_name = first_child->getText();
......@@ -1556,14 +1583,26 @@ void wb_wblnode::registerNode( wb_vrepwbl *vol)
// Get oix
ref_wblnode second_child = first_child->getNextSibling();
if ( second_child) {
ref_wblnode third_child = second_child->getNextSibling();
switch ( second_child->getType()) {
case tokens.VALUE:
case tokens.INT:
{
case tokens.INT: {
string oixstr = second_child->getText();
if ( !stringToOix( oixstr.c_str(), &o->m_oid.oix)) {
o->m_oid.oix = m_vrep->nextOix();
}
if ( third_child && third_child->getType() == tokens.ASC_TIME) {
string timestr = third_child->getText();
if ( !stringToTime( timestr.c_str(), &o->m_ohtime))
m_vrep->error( "Time syntax", getFileName(), line_number);
}
break;
}
case tokens.ASC_TIME: {
string timestr = second_child->getText();
if ( !stringToTime( timestr.c_str(), &o->m_ohtime))
m_vrep->error( "Time syntax", getFileName(), line_number);
break;
}
case tokens.ENDOBJECT:
......@@ -1821,7 +1860,7 @@ bool wb_wblnode::exportHead(wb_import &i)
i.importHead( o->m_oid, o->m_cid, fthoid, bwsoid, fwsoid, fchoid, lchoid, name(),
n.normName(cdh_mName_object), o->m_flags,
getFileTime(), getFileTime(), getFileTime(), o->rbody_size, o->dbody_size);
o->m_ohtime, o->m_rbtime, o->m_dbtime, o->rbody_size, o->dbody_size);
if ( o->fch)
o->fch->exportHead( i);
......
/**
* Proview $Id: wb_wblnode.h,v 1.17 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_wblnode.h,v 1.18 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -80,7 +80,7 @@ class wbl_type {
class wbl_body {
public:
wbl_body() : bix(pwr_eBix__), size(0) {};
wbl_body() : bix(pwr_eBix__), size(0) {}
pwr_eBix bix;
size_t size;
};
......@@ -114,6 +114,12 @@ class wbl_object {
m_flags.m = 0;
m_oid.oix = 0;
m_oid.vid = 0;
m_ohtime.tv_sec = 0;
m_ohtime.tv_nsec = 0;
m_rbtime.tv_sec = 0;
m_rbtime.tv_nsec = 0;
m_dbtime.tv_sec = 0;
m_dbtime.tv_nsec = 0;
};
~wbl_object() {
if ( rbody_size) free( rbody);
......@@ -126,6 +132,9 @@ class wbl_object {
pwr_tCid m_cid;
pwr_tTid m_tid;
pwr_tOid m_oid;
pwr_tTime m_ohtime;
pwr_tTime m_rbtime;
pwr_tTime m_dbtime;
char cname[32];
pwr_mClassDef m_flags;
wb_wblnode *fth;
......@@ -269,6 +278,7 @@ public:
ref_wblnode get_o_lch();
int classNameToCid( char *cname, pwr_tCid *cid);
int stringToOix( const char *buf, pwr_tOix *oix) const;
int stringToTime( const char *buf, pwr_tTime *time) const;
pwr_tCid Cid() { return o->c.cid;}
int attrStringToValue( int type_id, char *value_str,
void *buffer_ptr, size_t buff_size, size_t attr_size);
......
......@@ -253,6 +253,30 @@ void wb_wblparser::object() {
case ENDOBJECT:
case BODY:
case DOCBLOCK:
case ASC_TIME:
{
break;
}
default:
{
throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
}
}
}
{
switch ( LA(1)) {
case ASC_TIME:
{
ref_wblnode tmp9_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp9_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp9_AST));
match(ASC_TIME);
break;
}
case OBJECT:
case ENDOBJECT:
case BODY:
case DOCBLOCK:
{
break;
}
......@@ -269,11 +293,11 @@ void wb_wblparser::object() {
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
}
else {
goto _loop17;
goto _loop18;
}
}
_loop17:;
_loop18:;
}
{
for (;;) {
......@@ -282,9 +306,9 @@ void wb_wblparser::object() {
switch ( LA(1)) {
case DOCBLOCK:
{
ref_wblnode tmp9_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp9_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp9_AST));
ref_wblnode tmp10_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp10_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp10_AST));
match(DOCBLOCK);
break;
}
......@@ -302,15 +326,15 @@ void wb_wblparser::object() {
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
}
else {
goto _loop20;
goto _loop21;
}
}
_loop20:;
_loop21:;
}
ref_wblnode tmp10_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp10_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp10_AST));
ref_wblnode tmp11_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp11_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp11_AST));
match(ENDOBJECT);
object_AST = ref_wblnode(currentAST.root);
}
......@@ -331,18 +355,18 @@ void wb_wblparser::cid() {
switch ( LA(1)) {
case VALUE:
{
ref_wblnode tmp11_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp11_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp11_AST));
ref_wblnode tmp12_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp12_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp12_AST));
match(VALUE);
cid_AST = ref_wblnode(currentAST.root);
break;
}
case STRING_LITERAL:
{
ref_wblnode tmp12_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp12_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp12_AST));
ref_wblnode tmp13_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp13_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp13_AST));
match(STRING_LITERAL);
cid_AST = ref_wblnode(currentAST.root);
break;
......@@ -367,26 +391,48 @@ void wb_wblparser::body() {
ref_wblnode body_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
try { // for error handling
ref_wblnode tmp13_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp13_AST = astFactory.create(LT(1));
astFactory.makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp13_AST));
ref_wblnode tmp14_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp14_AST = astFactory.create(LT(1));
astFactory.makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp14_AST));
match(BODY);
{
switch ( LA(1)) {
case ASC_TIME:
{
ref_wblnode tmp15_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp15_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp15_AST));
match(ASC_TIME);
break;
}
case ENDBODY:
case ATTRIBUTE:
case BUFFER:
{
break;
}
default:
{
throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
}
}
}
{
for (;;) {
if ((LA(1)==ATTRIBUTE||LA(1)==BUFFER)) {
attribute();
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
}
else {
goto _loop23;
goto _loop25;
}
}
_loop23:;
_loop25:;
}
ref_wblnode tmp14_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp14_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp14_AST));
ref_wblnode tmp16_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp16_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp16_AST));
match(ENDBODY);
body_AST = ref_wblnode(currentAST.root);
}
......@@ -407,18 +453,18 @@ void wb_wblparser::oix() {
switch ( LA(1)) {
case VALUE:
{
ref_wblnode tmp15_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp15_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp15_AST));
ref_wblnode tmp17_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp17_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp17_AST));
match(VALUE);
oix_AST = ref_wblnode(currentAST.root);
break;
}
case INT:
{
ref_wblnode tmp16_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp16_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp16_AST));
ref_wblnode tmp18_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp18_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp18_AST));
match(INT);
oix_AST = ref_wblnode(currentAST.root);
break;
......@@ -446,25 +492,25 @@ void wb_wblparser::attribute() {
switch ( LA(1)) {
case ATTRIBUTE:
{
ref_wblnode tmp17_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp17_AST = astFactory.create(LT(1));
astFactory.makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp17_AST));
ref_wblnode tmp19_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp19_AST = astFactory.create(LT(1));
astFactory.makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp19_AST));
match(ATTRIBUTE);
{
switch ( LA(1)) {
case EQ:
{
ref_wblnode tmp18_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp18_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp18_AST));
ref_wblnode tmp20_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp20_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp20_AST));
match(EQ);
break;
}
case OREQ:
{
ref_wblnode tmp19_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp19_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp19_AST));
ref_wblnode tmp21_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp21_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp21_AST));
match(OREQ);
break;
}
......@@ -481,17 +527,17 @@ void wb_wblparser::attribute() {
}
case BUFFER:
{
ref_wblnode tmp20_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp20_AST = astFactory.create(LT(1));
astFactory.makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp20_AST));
ref_wblnode tmp22_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp22_AST = astFactory.create(LT(1));
astFactory.makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp22_AST));
match(BUFFER);
{
switch ( LA(1)) {
case INDEX:
{
ref_wblnode tmp21_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp21_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp21_AST));
ref_wblnode tmp23_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp23_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp23_AST));
match(INDEX);
break;
}
......@@ -514,15 +560,15 @@ void wb_wblparser::attribute() {
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
}
else {
goto _loop28;
goto _loop30;
}
}
_loop28:;
_loop30:;
}
ref_wblnode tmp22_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp22_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp22_AST));
ref_wblnode tmp24_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp24_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp24_AST));
match(ENDBUFFER);
attribute_AST = ref_wblnode(currentAST.root);
break;
......@@ -550,36 +596,36 @@ void wb_wblparser::value() {
switch ( LA(1)) {
case VALUE:
{
ref_wblnode tmp23_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp23_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp23_AST));
ref_wblnode tmp25_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp25_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp25_AST));
match(VALUE);
value_AST = ref_wblnode(currentAST.root);
break;
}
case STRING_LITERAL:
{
ref_wblnode tmp24_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp24_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp24_AST));
ref_wblnode tmp26_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp26_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp26_AST));
match(STRING_LITERAL);
value_AST = ref_wblnode(currentAST.root);
break;
}
case NUM_FLOAT:
{
ref_wblnode tmp25_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp25_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp25_AST));
ref_wblnode tmp27_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp27_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp27_AST));
match(NUM_FLOAT);
value_AST = ref_wblnode(currentAST.root);
break;
}
case INT:
{
ref_wblnode tmp26_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp26_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp26_AST));
ref_wblnode tmp28_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp28_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp28_AST));
match(INT);
value_AST = ref_wblnode(currentAST.root);
break;
......@@ -604,9 +650,9 @@ void wb_wblparser::oname() {
ref_wblnode oname_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
try { // for error handling
ref_wblnode tmp27_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp27_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp27_AST));
ref_wblnode tmp29_AST = static_cast<ref_wblnode>(ANTLR_USE_NAMESPACE(antlr)nullAST);
tmp29_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp29_AST));
match(VALUE);
oname_AST = ref_wblnode(currentAST.root);
}
......@@ -648,6 +694,7 @@ const char* wb_wblparser::_tokenNames[] = {
"INT",
"OID",
"DOCBLOCK",
"ASC_TIME",
"EQ",
"OREQ",
"WS",
......@@ -671,14 +718,14 @@ const ANTLR_USE_NAMESPACE(antlr)BitSet wb_wblparser::_tokenSet_1(_tokenSet_1_dat
const unsigned long wb_wblparser::_tokenSet_2_data_[] = { 8389618UL, 0UL, 0UL, 0UL };
// EOF OBJECT ENDOBJECT VOLUME ENDVOLUME SOBJECT ENDSOBJECT DOCBLOCK
const ANTLR_USE_NAMESPACE(antlr)BitSet wb_wblparser::_tokenSet_2(_tokenSet_2_data_,4);
const unsigned long wb_wblparser::_tokenSet_3_data_[] = { 551552048UL, 0UL, 0UL, 0UL };
// OBJECT ENDOBJECT BODY INT OID DOCBLOCK VALUE
const unsigned long wb_wblparser::_tokenSet_3_data_[] = { 1105200176UL, 0UL, 0UL, 0UL };
// OBJECT ENDOBJECT BODY INT OID DOCBLOCK ASC_TIME VALUE
const ANTLR_USE_NAMESPACE(antlr)BitSet wb_wblparser::_tokenSet_3(_tokenSet_3_data_,4);
const unsigned long wb_wblparser::_tokenSet_4_data_[] = { 8389808UL, 0UL, 0UL, 0UL };
// OBJECT ENDOBJECT ENDVOLUME BODY DOCBLOCK
const ANTLR_USE_NAMESPACE(antlr)BitSet wb_wblparser::_tokenSet_4(_tokenSet_4_data_,4);
const unsigned long wb_wblparser::_tokenSet_5_data_[] = { 8389680UL, 0UL, 0UL, 0UL };
// OBJECT ENDOBJECT BODY DOCBLOCK
const unsigned long wb_wblparser::_tokenSet_5_data_[] = { 25166896UL, 0UL, 0UL, 0UL };
// OBJECT ENDOBJECT BODY DOCBLOCK ASC_TIME
const ANTLR_USE_NAMESPACE(antlr)BitSet wb_wblparser::_tokenSet_5(_tokenSet_5_data_,4);
const unsigned long wb_wblparser::_tokenSet_6_data_[] = { 30720UL, 0UL, 0UL, 0UL };
// ENDBODY ATTRIBUTE BUFFER ENDBUFFER
......
......@@ -8,7 +8,7 @@ header {
header "post_include_hpp" {
extern int wblparser_error_cnt;
# This declarations should be moved inside parser class in wb_wblparser.hpp !!
# This_declarations_should_be_moved_inside_parser_class_in_wb_wblparser_hpp_!!
void reportError(const RecognitionException& ex);
}
header "post_include_cpp" {
......@@ -49,11 +49,11 @@ sobject
;
object
: OBJECT^ cid (oix)? (body)* ((DOCBLOCK)? object)* ENDOBJECT
: OBJECT^ cid (oix)? (ASC_TIME)? (body)* ((DOCBLOCK)? object)* ENDOBJECT
;
body
: BODY^ (attribute)* ENDBODY
: BODY^ (ASC_TIME)? (attribute)* ENDBODY
;
attribute
......
......@@ -25,17 +25,18 @@ struct wb_wblparserTokenTypes {
INT = 21,
OID = 22,
DOCBLOCK = 23,
EQ = 24,
OREQ = 25,
WS = 26,
COMMENT = 27,
INDEX = 28,
VALUE = 29,
CHAR_LITERAL = 30,
STRING_LITERAL = 31,
DIGITS = 32,
ESC = 33,
SWEC = 34,
ASC_TIME = 24,
EQ = 25,
OREQ = 26,
WS = 27,
COMMENT = 28,
INDEX = 29,
VALUE = 30,
CHAR_LITERAL = 31,
STRING_LITERAL = 32,
DIGITS = 33,
ESC = 34,
SWEC = 35,
NULL_TREE_LOOKAHEAD = 3
};
};
......
......@@ -20,14 +20,15 @@ NUM_FLOAT=20
INT=21
OID=22
DOCBLOCK=23
EQ=24
OREQ=25
WS=26
COMMENT=27
INDEX("an index")=28
VALUE("an identifer")=29
CHAR_LITERAL=30
STRING_LITERAL=31
DIGITS=32
ESC=33
SWEC=34
ASC_TIME=24
EQ=25
OREQ=26
WS=27
COMMENT=28
INDEX("an index")=29
VALUE("an identifer")=30
CHAR_LITERAL=31
STRING_LITERAL=32
DIGITS=33
ESC=34
SWEC=35
......@@ -25,17 +25,18 @@ struct wb_wblvocabTokenTypes {
INT = 21,
OID = 22,
DOCBLOCK = 23,
EQ = 24,
OREQ = 25,
WS = 26,
COMMENT = 27,
INDEX = 28,
VALUE = 29,
CHAR_LITERAL = 30,
STRING_LITERAL = 31,
DIGITS = 32,
ESC = 33,
SWEC = 34,
ASC_TIME = 24,
EQ = 25,
OREQ = 26,
WS = 27,
COMMENT = 28,
INDEX = 29,
VALUE = 30,
CHAR_LITERAL = 31,
STRING_LITERAL = 32,
DIGITS = 33,
ESC = 34,
SWEC = 35,
NULL_TREE_LOOKAHEAD = 3
};
};
......
......@@ -20,14 +20,15 @@ NUM_FLOAT=20
INT=21
OID=22
DOCBLOCK=23
EQ=24
OREQ=25
WS=26
COMMENT=27
INDEX("an index")=28
VALUE("an identifer")=29
CHAR_LITERAL=30
STRING_LITERAL=31
DIGITS=32
ESC=33
SWEC=34
ASC_TIME=24
EQ=25
OREQ=26
WS=27
COMMENT=28
INDEX("an index")=29
VALUE("an identifer")=30
CHAR_LITERAL=31
STRING_LITERAL=32
DIGITS=33
ESC=34
SWEC=35
/**
* Proview $Id: wb_wnav_item.cpp,v 1.13 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_wnav_item.cpp,v 1.14 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -344,12 +344,19 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
// Display object name
if ( wnav->editmode)
{
if ( wnav->editmode) {
item = (WItem *) new WItemObjectName( wnav->brow, wnav->ldhses, objid,
node, flow_eDest_IntoLast);
attr_exist = 1;
}
// Display modification time
if ( wnav->gbl.show_truedb) {
item = (WItem *) new WItemObjectModTime( wnav->brow, wnav->ldhses, objid,
node, flow_eDest_IntoLast);
attr_exist = 1;
}
// Get bodydef for rtbody, devbody or sysbody
sts = ldh_GetObjectClass( wnav->ldhses, objid, &classid);
......@@ -929,6 +936,50 @@ int WItemObjectName::get_value( char **value)
return WNAV__SUCCESS;
}
WItemObjectModTime::WItemObjectModTime(
WNavBrow *item_brow, ldh_tSesContext item_ldhses,
pwr_tObjid item_objid,
brow_tNode dest, flow_eDest dest_code) :
WItem( item_objid, 0), brow(item_brow), ldhses(item_ldhses)
{
int sts;
char timestr[40];
pwr_tTime time;
type = wnav_eItemType_ObjectModTime;
sts = ldh_GetModTime( ldhses, objid, &time);
if ( ODD(sts))
sts = time_AtoAscii( &time, time_eFormat_DateAndTime, timestr, sizeof(timestr));
if ( EVEN(sts))
strcpy( timestr, "Undefined");
brow_CreateNode( brow->ctx, "ModTime", brow->nc_attr,
dest, dest_code, (void *) this, 1, &node);
brow_SetAnnotPixmap( node, 0, brow->pixmap_objname);
// Set name
brow_SetAnnotation( node, 0, "ModificationTime", strlen("ModificaionTime"));
brow_SetAnnotation( node, 1, timestr, strlen(timestr));
}
int WItemObjectModTime::update()
{
char timestr[40];
pwr_tTime time;
int sts;
sts = ldh_GetModTime( ldhses, objid, &time);
if ( ODD(sts))
sts = time_AtoAscii( &time, time_eFormat_DateAndTime, timestr, sizeof(timestr));
if ( EVEN(sts))
strcpy( timestr, "Undefined");
brow_SetAnnotation( node, 1, timestr, strlen(timestr));
return WNAV__SUCCESS;
}
WItemFile::WItemFile( WNav *wnav, char *item_name, char *text,
char *item_file_name, item_eFileType item_filetype,
brow_tNode dest, flow_eDest dest_code) :
......
/**
* Proview $Id: wb_wnav_item.h,v 1.8 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_wnav_item.h,v 1.9 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -59,7 +59,8 @@ typedef enum {
wnav_eItemType_File,
wnav_eItemType_Text,
wnav_eItemType_Crossref,
wnav_eItemType_DocBlock
wnav_eItemType_DocBlock,
wnav_eItemType_ObjectModTime
} wnav_eItemType;
typedef enum {
......@@ -188,6 +189,18 @@ class WItemObjectName : public WItem {
int get_value( char **value); // The value should be freed with free
};
class WItemObjectModTime : public WItem {
public:
WItemObjectModTime(
WNavBrow *item_brow, ldh_tSesContext item_ldhses,
pwr_tObjid item_objid,
brow_tNode dest, flow_eDest dest_code);
WNavBrow *brow;
ldh_tSesContext ldhses;
int update();
};
class WItemDocBlock : public WItem {
public:
WItemDocBlock(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment