Skip to content

Commit e3c6050

Browse files
committed
1 parent 3c0de7c commit e3c6050

358 files changed

Lines changed: 6072 additions & 5154 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from construct import *
2+
from construct.lib import *
3+
4+
name_clash_import_vs_inst = Struct(
5+
'integers' / Pointer(0, LazyBound(lambda: integers)),
6+
'std' / Computed(lambda this: 1 + 2),
7+
)
8+
9+
_schema = name_clash_import_vs_inst
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
2+
3+
#include "name_clash_import_vs_inst.h"
4+
5+
name_clash_import_vs_inst_t::name_clash_import_vs_inst_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, name_clash_import_vs_inst_t* p__root) : kaitai::kstruct(p__io) {
6+
m__parent = p__parent;
7+
m__root = p__root ? p__root : this;
8+
m_integers = nullptr;
9+
f_integers = false;
10+
f_std = false;
11+
_read();
12+
}
13+
14+
void name_clash_import_vs_inst_t::_read() {
15+
}
16+
17+
name_clash_import_vs_inst_t::~name_clash_import_vs_inst_t() {
18+
_clean_up();
19+
}
20+
21+
void name_clash_import_vs_inst_t::_clean_up() {
22+
if (f_integers) {
23+
}
24+
}
25+
26+
integers_t* name_clash_import_vs_inst_t::integers() {
27+
if (f_integers)
28+
return m_integers.get();
29+
f_integers = true;
30+
std::streampos _pos = m__io->pos();
31+
m__io->seek(0);
32+
m_integers = std::unique_ptr<integers_t>(new integers_t(m__io));
33+
m__io->seek(_pos);
34+
return m_integers.get();
35+
}
36+
37+
int32_t name_clash_import_vs_inst_t::std() {
38+
if (f_std)
39+
return m_std;
40+
f_std = true;
41+
m_std = 1 + 2;
42+
return m_std;
43+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#pragma once
2+
3+
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
4+
5+
class name_clash_import_vs_inst_t;
6+
7+
#include "kaitai/kaitaistruct.h"
8+
#include <stdint.h>
9+
#include <memory>
10+
#include "integers.h"
11+
12+
#if KAITAI_STRUCT_VERSION < 11000L
13+
#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required"
14+
#endif
15+
16+
class name_clash_import_vs_inst_t : public kaitai::kstruct {
17+
18+
public:
19+
20+
name_clash_import_vs_inst_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, name_clash_import_vs_inst_t* p__root = nullptr);
21+
22+
private:
23+
void _read();
24+
void _clean_up();
25+
26+
public:
27+
~name_clash_import_vs_inst_t();
28+
integers_t* integers();
29+
int32_t std();
30+
name_clash_import_vs_inst_t* _root() const { return m__root; }
31+
kaitai::kstruct* _parent() const { return m__parent; }
32+
33+
private:
34+
bool f_integers;
35+
std::unique_ptr<integers_t> m_integers;
36+
bool f_std;
37+
int32_t m_std;
38+
name_clash_import_vs_inst_t* m__root;
39+
kaitai::kstruct* m__parent;
40+
};
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
2+
3+
#include "name_clash_import_vs_inst.h"
4+
5+
name_clash_import_vs_inst_t::name_clash_import_vs_inst_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, name_clash_import_vs_inst_t* p__root) : kaitai::kstruct(p__io) {
6+
m__parent = p__parent;
7+
m__root = p__root ? p__root : this;
8+
m_integers = 0;
9+
f_integers = false;
10+
f_std = false;
11+
12+
try {
13+
_read();
14+
} catch(...) {
15+
_clean_up();
16+
throw;
17+
}
18+
}
19+
20+
void name_clash_import_vs_inst_t::_read() {
21+
}
22+
23+
name_clash_import_vs_inst_t::~name_clash_import_vs_inst_t() {
24+
_clean_up();
25+
}
26+
27+
void name_clash_import_vs_inst_t::_clean_up() {
28+
if (f_integers) {
29+
if (m_integers) {
30+
delete m_integers; m_integers = 0;
31+
}
32+
}
33+
}
34+
35+
integers_t* name_clash_import_vs_inst_t::integers() {
36+
if (f_integers)
37+
return m_integers;
38+
f_integers = true;
39+
std::streampos _pos = m__io->pos();
40+
m__io->seek(0);
41+
m_integers = new integers_t(m__io);
42+
m__io->seek(_pos);
43+
return m_integers;
44+
}
45+
46+
int32_t name_clash_import_vs_inst_t::std() {
47+
if (f_std)
48+
return m_std;
49+
f_std = true;
50+
m_std = 1 + 2;
51+
return m_std;
52+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#ifndef NAME_CLASH_IMPORT_VS_INST_H_
2+
#define NAME_CLASH_IMPORT_VS_INST_H_
3+
4+
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
5+
6+
class name_clash_import_vs_inst_t;
7+
8+
#include "kaitai/kaitaistruct.h"
9+
#include <stdint.h>
10+
#include "integers.h"
11+
12+
#if KAITAI_STRUCT_VERSION < 11000L
13+
#error "Incompatible Kaitai Struct C++/STL API: version 0.11 or later is required"
14+
#endif
15+
16+
class name_clash_import_vs_inst_t : public kaitai::kstruct {
17+
18+
public:
19+
20+
name_clash_import_vs_inst_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, name_clash_import_vs_inst_t* p__root = 0);
21+
22+
private:
23+
void _read();
24+
void _clean_up();
25+
26+
public:
27+
~name_clash_import_vs_inst_t();
28+
integers_t* integers();
29+
int32_t std();
30+
name_clash_import_vs_inst_t* _root() const { return m__root; }
31+
kaitai::kstruct* _parent() const { return m__parent; }
32+
33+
private:
34+
bool f_integers;
35+
integers_t* m_integers;
36+
bool f_std;
37+
int32_t m_std;
38+
name_clash_import_vs_inst_t* m__root;
39+
kaitai::kstruct* m__parent;
40+
};
41+
42+
#endif // NAME_CLASH_IMPORT_VS_INST_H_
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
2+
3+
4+
5+
namespace Kaitai
6+
{
7+
public partial class NameClashImportVsInst : KaitaiStruct
8+
{
9+
public static NameClashImportVsInst FromFile(string fileName)
10+
{
11+
return new NameClashImportVsInst(new KaitaiStream(fileName));
12+
}
13+
14+
public NameClashImportVsInst(KaitaiStream p__io, KaitaiStruct p__parent = null, NameClashImportVsInst p__root = null) : base(p__io)
15+
{
16+
m_parent = p__parent;
17+
m_root = p__root ?? this;
18+
f_integers = false;
19+
f_std = false;
20+
_read();
21+
}
22+
private void _read()
23+
{
24+
}
25+
public Integers Integers
26+
{
27+
get
28+
{
29+
if (f_integers)
30+
return _integers;
31+
f_integers = true;
32+
long _pos = m_io.Pos;
33+
m_io.Seek(0);
34+
_integers = new Integers(m_io);
35+
m_io.Seek(_pos);
36+
return _integers;
37+
}
38+
}
39+
public int Std
40+
{
41+
get
42+
{
43+
if (f_std)
44+
return _std;
45+
f_std = true;
46+
_std = (int) (1 + 2);
47+
return _std;
48+
}
49+
}
50+
public NameClashImportVsInst M_Root { get { return m_root; } }
51+
public KaitaiStruct M_Parent { get { return m_parent; } }
52+
private bool f_integers;
53+
private Integers _integers;
54+
private bool f_std;
55+
private int _std;
56+
private NameClashImportVsInst m_root;
57+
private KaitaiStruct m_parent;
58+
}
59+
}

compiled/go/src/test_formats/name_clash_import_vs_inst.go

Lines changed: 67 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
digraph {
2+
rankdir=LR;
3+
node [shape=plaintext];
4+
subgraph cluster__name_clash_import_vs_inst {
5+
label="NameClashImportVsInst";
6+
graph[style=dotted];
7+
8+
name_clash_import_vs_inst__seq [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
9+
<TR><TD BGCOLOR="#E0FFE0">pos</TD><TD BGCOLOR="#E0FFE0">size</TD><TD BGCOLOR="#E0FFE0">type</TD><TD BGCOLOR="#E0FFE0">id</TD></TR>
10+
</TABLE>>];
11+
name_clash_import_vs_inst__inst__integers [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
12+
<TR><TD BGCOLOR="#E0FFE0">pos</TD><TD BGCOLOR="#E0FFE0">size</TD><TD BGCOLOR="#E0FFE0">type</TD><TD BGCOLOR="#E0FFE0">id</TD></TR>
13+
<TR><TD PORT="integers_pos">0</TD><TD PORT="integers_size">148</TD><TD>Integers</TD><TD PORT="integers_type">integers</TD></TR>
14+
</TABLE>>];
15+
name_clash_import_vs_inst__inst__std [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
16+
<TR><TD BGCOLOR="#E0FFE0">id</TD><TD BGCOLOR="#E0FFE0">value</TD></TR>
17+
<TR><TD>std</TD><TD>1 + 2</TD></TR>
18+
</TABLE>>];
19+
}
20+
name_clash_import_vs_inst__inst__integers:integers_type -> integers__seq [style=bold];
21+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
<!doctype html>
3+
<html lang="en">
4+
<head>
5+
<!-- Required meta tags -->
6+
<meta charset="utf-8">
7+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
8+
9+
<!-- Bootstrap CSS -->
10+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
11+
12+
<title>NameClashImportVsInst format specification</title>
13+
</head>
14+
<body>
15+
<div class="container">
16+
<h1>NameClashImportVsInst format specification</h1>
17+
18+
19+
<a name='type-name_clash_import_vs_inst'></a>
20+
<h1>Type: NameClashImportVsInst</h1>
21+
22+
<table class="table">
23+
<tr><th>Offset</th><th>Size</th><th>ID</th><th>Type</th><th>Note</th></tr>
24+
</table>
25+
<p><b>Parse instance</b>: integers</p>
26+
<table class="table">
27+
<tr>
28+
<td>0</td>
29+
<td>...</td>
30+
<td>integers</td>
31+
<td><a href="#type-integers">Integers</a></td>
32+
<td></td>
33+
</tr>
34+
</table>
35+
value instance: ValueInstanceSpec(InstanceIdentifier(std),List(instances, std),BinOp(IntNum(1),Add,IntNum(2)),None,Some(CalcIntType),DocSpec(None,List()))
36+
37+
</div>
38+
<!-- Optional JavaScript -->
39+
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
40+
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
41+
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
42+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
43+
</body>
44+
</html>
45+

0 commit comments

Comments
 (0)